ilan Expert Licensed User Longtime User Mar 20, 2015 #1 i have a problem with the HttpUtils Service i am trying to download a string and everything is ok, the problem is after i update the textfile on my server the app downloads the old text. if i enter the address to the textfile in my browser i am getting the new text. if i use ftp download in my app i am also getting the new string. but with httputils i am getting the old text and only after a while or app restarts i am getting the new text. what could be the reason for that? why i am not getting the new text immidiatly after uploading the file? could it be that i need to clear the "TempFolder = File.DirInternalCache" ?? and if yes how?
i have a problem with the HttpUtils Service i am trying to download a string and everything is ok, the problem is after i update the textfile on my server the app downloads the old text. if i enter the address to the textfile in my browser i am getting the new text. if i use ftp download in my app i am also getting the new string. but with httputils i am getting the old text and only after a while or app restarts i am getting the new text. what could be the reason for that? why i am not getting the new text immidiatly after uploading the file? could it be that i need to clear the "TempFolder = File.DirInternalCache" ?? and if yes how?
Erel B4X founder Staff member Licensed User Longtime User Mar 20, 2015 #2 HttpUtils2 doesn't cache anything. Make sure that Job.Success is true. It is probably your server who sends the same file. You can try to add a "dummy" parameter to the link: Code: YourLink & "?dummy=" & DateTime.Now Upvote 0
HttpUtils2 doesn't cache anything. Make sure that Job.Success is true. It is probably your server who sends the same file. You can try to add a "dummy" parameter to the link: Code: YourLink & "?dummy=" & DateTime.Now
ilan Expert Licensed User Longtime User Mar 20, 2015 #3 Erel said: HttpUtils2 doesn't cache anything. Make sure that Job.Success is true. It is probably your server who sends the same file. You can try to add a "dummy" parameter to the link: Code: YourLink & "?dummy=" & DateTime.Now Click to expand... but the same file is no more available, how can it be that its downloading the file?? here is an example: i have deleted this file in my server: http://www.sagital.byethost7.com/lists/0504844663.txt if you will put http://www.sagital.byethost7.com/lists/0504844663.txt in your browser you will get an error... but the app still download the file like its exists... Upvote 0
Erel said: HttpUtils2 doesn't cache anything. Make sure that Job.Success is true. It is probably your server who sends the same file. You can try to add a "dummy" parameter to the link: Code: YourLink & "?dummy=" & DateTime.Now Click to expand... but the same file is no more available, how can it be that its downloading the file?? here is an example: i have deleted this file in my server: http://www.sagital.byethost7.com/lists/0504844663.txt if you will put http://www.sagital.byethost7.com/lists/0504844663.txt in your browser you will get an error... but the app still download the file like its exists...
udg Expert Licensed User Longtime User Mar 20, 2015 #4 Hi Ilan, could it be that your app doesn't load again the now un-existent file but simply accesses a local temp copy you made along its first original download? I mean something like: Code: .... if successful the copy to local dir end if release job call sub "next step" end sub sub next step access local file proccess it end sub In the above scheme, when download is unsuccessful, "next step" is called anyway (and it finds "the" file). Upvote 0
Hi Ilan, could it be that your app doesn't load again the now un-existent file but simply accesses a local temp copy you made along its first original download? I mean something like: Code: .... if successful the copy to local dir end if release job call sub "next step" end sub sub next step access local file proccess it end sub In the above scheme, when download is unsuccessful, "next step" is called anyway (and it finds "the" file).
ilan Expert Licensed User Longtime User Mar 20, 2015 #5 i am saving the text i am downloading to a file but i am looking in my logs and i see the old text again and again also after i have uploaded a new file only after about 10min i see the updated text i cannot explain that issue... Code: Case "Job3" txtsh3 = " " Log(txtsh3) txtsh3 = job.GetString Log(txtsh3) '..... as you can see first i reset the string "txtsh3" to "" then check in logs that its really blank then download the job and check again in logs... before i did anything... Upvote 0
i am saving the text i am downloading to a file but i am looking in my logs and i see the old text again and again also after i have uploaded a new file only after about 10min i see the updated text i cannot explain that issue... Code: Case "Job3" txtsh3 = " " Log(txtsh3) txtsh3 = job.GetString Log(txtsh3) '..... as you can see first i reset the string "txtsh3" to "" then check in logs that its really blank then download the job and check again in logs... before i did anything...
DonManfred Expert Licensed User Longtime User Mar 20, 2015 #6 Did you DIm a New httpjob each time vor are you using the same jobobject each time? Upvote 0
ilan Expert Licensed User Longtime User Mar 20, 2015 #7 DonManfred said: Did you DIm a New httpjob each time vor are you using the same jobobject each time? Click to expand... yes Upvote 0
DonManfred said: Did you DIm a New httpjob each time vor are you using the same jobobject each time? Click to expand... yes
DonManfred Expert Licensed User Longtime User Mar 20, 2015 #8 yes same or yes dim each time a new? Upvote 0
ilan Expert Licensed User Longtime User Mar 20, 2015 #9 DonManfred said: yes same or yes dim each time a new? Click to expand... i use the same job always again and again... the app is looking every 30 sec for a new file and if there is one it downloads it... how can i creat every time a new Job?? is it possible? Upvote 0
DonManfred said: yes same or yes dim each time a new? Click to expand... i use the same job always again and again... the app is looking every 30 sec for a new file and if there is one it downloads it... how can i creat every time a new Job?? is it possible?
udg Expert Licensed User Longtime User Mar 20, 2015 #10 is it possible? Click to expand... Why not? Just call job.release while closing the JobDone sub and dim a job again before next download execution. Upvote 0
is it possible? Click to expand... Why not? Just call job.release while closing the JobDone sub and dim a job again before next download execution.
ilan Expert Licensed User Longtime User Mar 20, 2015 #11 jobDone got allready Job.Release and every time i dim a job (but with the same name) Upvote 0
DonManfred Expert Licensed User Longtime User Mar 20, 2015 #12 ilan said: every time i dim a job (but with the same name) Click to expand... That´s what i wanted to know.OK. This should work then... hmmm Upvote 0
ilan said: every time i dim a job (but with the same name) Click to expand... That´s what i wanted to know.OK. This should work then... hmmm
ilan Expert Licensed User Longtime User Mar 20, 2015 #13 could it be because i am using a Free FTP server? byethost7.com i have also a paid one but cannot access it from my app (Filezilla FTP) Upvote 0
could it be because i am using a Free FTP server? byethost7.com i have also a paid one but cannot access it from my app (Filezilla FTP)
udg Expert Licensed User Longtime User Mar 20, 2015 #14 I'd have suspected a caching on the server if you weren't exeperiencing an immediate new data availability from browser and ftp client. So it appears that the GET from httputils is worked on differently by the server than the one from the browser and that's sounds strange. I guess you don't need suggestion on how to circumvent the problem since you're more interested in understanding why it happens at all (me too ). Upvote 0
I'd have suspected a caching on the server if you weren't exeperiencing an immediate new data availability from browser and ftp client. So it appears that the GET from httputils is worked on differently by the server than the one from the browser and that's sounds strange. I guess you don't need suggestion on how to circumvent the problem since you're more interested in understanding why it happens at all (me too ).
ilan Expert Licensed User Longtime User Mar 20, 2015 #15 udg said: I guess you don't need suggestion on how to circumvent the problem since you're more interested in understanding why it happens at all Click to expand... yep, i have solved the problem by downloading the file via FTP (Http would be simpler) so my app is working but still as you said i would like to understand why its doing it.. Upvote 0
udg said: I guess you don't need suggestion on how to circumvent the problem since you're more interested in understanding why it happens at all Click to expand... yep, i have solved the problem by downloading the file via FTP (Http would be simpler) so my app is working but still as you said i would like to understand why its doing it..