Automatic uploading files incorrectly

Advertisement

macat
Joined:
Posts:
2
Location:
WA

Automatic uploading files incorrectly

I am not a tech expert so don't know how to fix this, I have my upload set to automatic and it is uploading php files in text instead of binary, how can I fix this. These are huge scripts and would take forever to do them manually. Many of the features don't work correctly when the file gets uploaded incorrectly???

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
31,598
Location:
Prague, Czechia

Re: Automatic uploading files incorrectly

How do you have "upload set to automatic"?

WinSCP defaults to the binary mode. So if you have any kind of script, it must override the defaults.

Or you have changed the defaults in WinSCP GUI configuration and your script is not isolated from the GUI configuration.
https://winscp.net/eng/docs/scripting#configuration

If you need a more specific help, please attach a full session log file showing the problem.

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

macat
Joined:
Posts:
2
Location:
WA

Re: Automatic uploading files incorrectly

I have a managed dedicated server because I am not technically inclined, truthfully all you said was above my head, I have no idea what you are talking about. I design websites, and the tech people take care of my server if there are any issues. I don't use SSH, telnet, only FTP. I just went through each folder and found about 25 or so files that had not been uploaded correctly, they got uploaded as text and should have been uploaded as binary. I have my upload configuration set to default and it uploads some files incorrectly. This script has over 2500 files and going thru manually each time I upgrade to the latest version isn't realistic. Fillzilla also did this, that is why I switched to this program.

The files I ended up uploading again were js, php and a few css files.

martin wrote:

How do you have "upload set to automatic"?

WinSCP defaults to the binary mode. So if you have any kind of script, it must override the defaults.

Or you have changed the defaults in WinSCP GUI configuration and your script is not isolated from the GUI configuration.
https://winscp.net/eng/docs/scripting#configuration

If you need a more specific help, please attach a full session log file showing the problem.

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote E-mail

Helvetica
Donor
Joined:
Posts:
4
Location:
Switzerland

Try this: It may look complicated but this is only because I am trying to give you the steps in a simple-ish manner.
In your WinSCP click on Options -> Preferences. In the list on the left is a section called Transfers.
Click on the word "Transfers" and you will see a window on the right, called "Transfer Preset Settings".
You say that you have your WinSCP set to Default. Default on my WinSCP is actually "Binary".
OK, mark (in the window on the right) the word "Default" and in the bottom window, click Edit.
Now, in the Edit window, at the top, is the "Binary" selected ?
If it is, have a look at the (greyed out) line "Transfer following files in Text Mode" just beneath the Binary / Text / etc. options. You might find that it also contains *php and some others which you actually want to transfer in binary, so to change that, you need to click on the "Text" option and get rid of them there.
THEN...
Go back and mark the "Binary" option
At the bottom of the window there is a line called "Other" and an entry field called "File Mask".
You could try adding .php to that (Binary) File mask (read the mask hints, but it will be *.php and *.___ for any others you want to upload as binary).
Click OK, restart the program and do a test to see if it works.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,598
Location:
Prague, Czechia

Check the instructions by @Helvetica for checking that you have the Binary mode selected.
Check also the documentation:
https://winscp.net/eng/docs/ui_pref_transfer
https://winscp.net/eng/docs/ui_transfer_custom

Actually, the rest of the suggestions (about file masks) are irrelevant, so you can skip those.

If it does not help, please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum