Parse errors uploading php files on live servers

Advertisement

Tasso
Guest

Parse errors uploading php files on live servers

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!

Reply with quote

Advertisement

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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,074
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

Reply with quote

Tasso
Guest

Thanks!

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.

Reply with quote

Advertisement

You can post new topics in this forum