Topic "Parse errors uploading php files on live servers"

Author Message
Tasso

Guest


Using winscp (and many ohers...) to upload files to live webservers causes temporary and impredictable errors, I'll explain with an example:

I am uploading a 100k script on a live server and this takes 2 seconds.
While uploading someone on the Net calls some page that uses that script.
The server includes/uses a partially uploaded file giving most of the times parse errors and some rare times unpredictable errors.

The solution could be simple: upload the file (ex. auth.php) to a temporary file (ex. auth.php.winscp.tmp) and only when 100% uploaded it renames the temp to the originary file overwriting it.

This would make live uploads secure with Winscp!
Advertisements
TS

Guest


WinSCP already does this for files > 100kB by default. You can change the 100kB limit to something else if you prefer.
Tasso

Guest


TS wrote:
WinSCP already does this for files > 100kB by default. You can change the 100kB limit to something else if you prefer.


Thanks for the reply, but that isn't the solution: first it works only for binary data, but i forced binary uploads per each file, even .php

Second and mosto important WinSCP first deletes the file, then creates the 'growing' .filepart and then renames it to the original.

This changes the problem from having a 'partial uploaded' script prone to errors to a missing script while it is being uploaded.

In both cases if the transfer interrupts I have or a half file (with parse error) or a missing file (with http 404 errors).

IMHO me the solution would be using the resume option if this WOULD NOT DELETE the file while uploading it.

Thanks, bye.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Tasso wrote:
This changes the problem from having a 'partial uploaded' script prone to errors to a missing script while it is being uploaded.

In both cases if the transfer interrupts I have or a half file (with parse error) or a missing file (with http 404 errors).

The next version will remove the file only after transfer to temporary file finishes.
_________________
Martin Prikryl
Tasso

Guest


Thanks very much!

That would be very very important for programmers who love to work on live servers which is like being a surgeon operating on an open hearth.

I am bowing to you.

Thanks again,
Bye from Italy,
Davide Tassetti.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License