Author Topic: FTP uploads to web site  (Read 1605 times)

0 Members and 1 Guest are viewing this topic.

Offline gbuxton

  • Member
  • *
  • Posts: 7
    • Bentwater on Lake Granbury Weather
FTP uploads to web site
« on: March 02, 2011, 01:14:07 PM »
Software such as VWS and Lightning/2000 offer the option of temporarily renaming a file for upload to the web site.
What is the purpose and benefit of this?  More specifically,
I have occasional errors where a data file or an image is not found, I presume it's because a newer one was in the process of uploading at that moment.
I have the FTP set to rename, which I presume causes a very short period when the existing file was deleted and the new temp file renamed to the desired file name on the server.
If the rename option were not used and the uploading file was overwriting the existing file, would the server wait for access to the file before opening it rather than returning a not found?
Thanks...
Jerry

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: FTP uploads to web site
« Reply #1 on: March 02, 2011, 01:25:48 PM »
During the period when the file is getting written, you might not get anything at all, just like the file doesn't exist. Generally those options will upload the file with a temp extension, then delete and rename the newly uploaded file.

Using that option will most likely take care of your problem and that is why it's included as an option.

Offline gbuxton

  • Member
  • *
  • Posts: 7
    • Bentwater on Lake Granbury Weather
Re: FTP uploads to web site
« Reply #2 on: March 03, 2011, 09:04:25 AM »
Thanks for your reply DaculaWeather. (sorry for the original misspelling, this is a correction!)
I understand your point but, I am having the problem and I am already set for rename.  Perhaps I can handle it in my code.  I would think the server would lock the file and therefore the file read process while it's being updated?
« Last Edit: March 03, 2011, 03:35:25 PM by gbuxton »
Jerry

Offline xykotik

  • DonkeyTailWX DW6891
  • Forecaster
  • *****
  • Posts: 696
  • I'll deal with it tomorrow
    • DonkeyTail Weather
Re: FTP uploads to web site
« Reply #3 on: March 05, 2011, 10:53:48 AM »
I don't use those packages, but in some (like WeatherLink) it only processes files ending in .htx (so it can identify template code) and then can rename the processed file to html, php, txt, whatever you need for that purpose before it uploads.  Is that what you need?  I have my files renamed to php, even if they are just txt files that I am parsing (like for wxgraphic) so I can get it all done with a single upload profile.  Renaming your main html files as php will still work, as long as they have <?php  ?> somewhere inside, like at the very top if you are not actually using php.  Then just call them from your links (or browser) as "index.php" instead of "index.html"

I don't know if this addresses your concern.


Facit solem suum oriri super bonos et malos et pluit super iustos et iniustos.

Springtime in Seattle...  March comes in like a lion and out like a wet lion.

Offline gbuxton

  • Member
  • *
  • Posts: 7
    • Bentwater on Lake Granbury Weather
Re: FTP uploads to web site
« Reply #4 on: March 08, 2011, 01:32:45 PM »
Hi xykotik,

VWS does the same type of thing when creating its own web pages, you use a file with the extension .htx as the template and you can have it spit it out in whatever filename you like.  The .htx could then be in any format you want, html, php etc. and VWS just fills in the variables with the data.
The specific instance I'm referring to is that during the FTP process that lets the FTP upload the file to the server as a temporary file name, then rename that to the final product (page) name that you use on your website.
I'm not sure if that technique, or the technique of just uploading the file straight out with the desired page name (or image name in my problem instance) allows for a very short period of the file (image) not existing, that give the page the opportunity on a refresh to have an image not found problem.
Being rather new to web publishing though, it may well be the way I have written my code.  That's what I'm trying to find out, if I need to allow something for the instant that the image is being refreshed (uploaded) on the server, or whether IIS 7.0 and ASP.NET should cover for you and if the file is in use, pause until it is available before rendering the image.
Jerry

Offline xykotik

  • DonkeyTailWX DW6891
  • Forecaster
  • *****
  • Posts: 696
  • I'll deal with it tomorrow
    • DonkeyTail Weather
Re: FTP uploads to web site
« Reply #5 on: March 09, 2011, 09:40:10 AM »
OK, I think I see what is problematic for you, but have no solution. (big, fat help I am... ](*,))

I am not a Linux server, and am not using ASP code, but I have also noticed random things occasionally being temporarily "broken" on my wx page if I am refreshing during an upload event.


Facit solem suum oriri super bonos et malos et pluit super iustos et iniustos.

Springtime in Seattle...  March comes in like a lion and out like a wet lion.

 

anything