This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Issue: File downloads content not being updated under Windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Issue: File downloads content not being updated under Windows" Watch "Issue: File downloads content not being updated under Windows" New topic
Author

Issue: File downloads content not being updated under Windows

Olivier López
Ranch Hand

Joined: Jan 31, 2010
Posts: 32
Hello everybody, i hope you can help me one more time as usual =D

Maybe the title doesnt explain the issue very clear, but this is the weirdest challenge that i have had since i started on programming:

Step1: I upload a file called "Version.dat" to a webhost. It is a txt file renamed to .dat and inside the file i wrote "100" (http://galeon.com/pmautofiller/PPMAutoFiller/Version.dat)

Step2: I download the file on my pc, then i open it with notepad and inside i can see the content "100"

Step3: I change the content of the previous Version.dat file from "100" to "200", then i delete the file from the server and upload the new one with "200".

Step4: I download teh Version.dat file one more time. Then open it with notepad and "SURPRISE¡¡¡", the content is "100" instead of "200"

Step5:I make another Version.dat text file and write "300" on it. Delete the one that is on the webhost. Upload the new one. Download it again. Still showing "100"


I tried this on about 5 different computers and all of them shows the same behaviour. If i download the file on a completely different computer, it shows "300" (the last update that i did to the file), but if i repeat the update process on the file and
replace "300" with "400", that other computer will always show "300".

Im posting this here because i tried to read the file from java. Then i tried uploading and downloading the file manually with Internet Explorer, firefox and Google Chrome and its the same issue with all of them.


Have anyone else experienced something like this before? I tried to look on the internet but wasnt able to find any related info.

I Hope someone have a clue about how to fix it, this is the only and last inconvenience i have with the application im developing. As soon as i figure it out i will done =D

Thanks in advanced, Regards






William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

The first time you download the file will be called Version.dat

The next time, Version (1).dat
Then, Version (2).dat

and so on ... (At least using Chrome, unless you overwrite or delete the original file)
Open up your downloads folder to verify this.

I'm guessing you are opening the original file which of course contains whatever value was there at the time.

Pat.
Olivier López
Ranch Hand

Joined: Jan 31, 2010
Posts: 32
William P O'Sullivan wrote:The first time you download the file will be called Version.dat

The next time, Version (1).dat
Then, Version (2).dat

and so on ... (At least using Chrome, unless you overwrite or delete the original file)
Open up your downloads folder to verify this.

I'm guessing you are opening the original file which of course contains whatever value was there at the time.

Pat.


Thanks for your reponse.
I though the same, but if i download version.dat, then Delete if from the system, and download it a second time but with a different value, the second file contains the same content as the first one. I deleted the first one
so i have no clue why that happens.

Since i had to finish his project about 1 week ago, what i did is to make the aplication read the content of Version.dat from an FTP server located on my local PC, it looks like when the application
reads the file in this way, i doesnt keep the previous file values.

It looks more like a user mistake, but trust me, so far I have tried to reproduce all my posible mistakes and i think im doing everything right.

Thanks again !

 
GeeCON Prague 2014
 
subject: Issue: File downloads content not being updated under Windows