Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Agreed, but resuming isn't what's needed, it would just be great that $FILENAME is being uploaded as $FILENAME.filepart and renamed to $FILENAME when uploading has finished.

I understand your problem. Maybe if more people ask for it, I'll consider adding such a feature.
Guest

martin wrote:

Resuming is not supported for text transfer mode. You may need to force binary mode.

Agreed, but resuming isn't what's needed, it would just be great that $FILENAME is being uploaded as $FILENAME.filepart and renamed to $FILENAME when uploading has finished.
martin

lee_r wrote:

Then I tried the same using a 2 MB TXT file and a 150 KB PHP file (text mode transfer)
Both were uploaded using the filename without the temporary filepart extension.
The same goes for overwriting, the previous file is just being deleted and then the upload starts using $FILENAME.

Looks like a bug when using text transfer mode.
If it helps I'm using WinSCP 3.8.2 (Build 330).

Resuming is not supported for text transfer mode. You may need to force binary mode.
lee_r

I was able to nail down the circumstances under which the problem happens:
in binary transfer mode both uploading and overwriting is done correctly using $FILENAME.filepart.
I've tested this with an EXE and a ZIP file -> both fine, because it's binary transfer.

Then I tried the same using a 2 MB TXT file and a 150 KB PHP file (text mode transfer)
Both were uploaded using the filename without the temporary filepart extension.
The same goes for overwriting, the previous file is just being deleted and then the upload starts using $FILENAME.

Looks like a bug when using text transfer mode.
If it helps I'm using WinSCP 3.8.2 (Build 330).
martin

lee_r wrote:

Thanks for the hint, but this doesn't seem to work when you want to overwrite existing files, only when uploading new files.

I do not think so. What does happen if you are overtwritting the existing files?
lee_r

Thanks for the hint, but this doesn't seem to work when you want to overwrite existing files, only when uploading new files.
martin

Re: Rename file during upload

If you use SFTP protocol, you may enable transfer resuming for all files, which results in behaviour you describe.
lee_r

Rename file during upload

Situation:
You upload a 100 KB PHP/Python/Ruby/whatever file to your webserver.
During the upload (especially on slow lines) the file can possibly be retrieved partially because parsing doesn't work yet.
Just imagine the login data to your database can be seen in clear text in the browser of someone accidentally loading a website while you upload it.
This also affects editing and saving a file in WinSCP.

Solution:
Option for uploading the file renamed like $FILENAME_temp$threerandomchars and automatic renaming to the original filename when uploading is finished.