macat
Joined:
Posts:
2
Location:
WA

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???

martin
Joined:
Posts:
33,710
Location:
Prague, Czechia

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.

macat
Joined:
Posts:
2
Location:
WA

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.

Helvetica
Donor
Joined:
Posts:
18
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.

martin
Joined:
Posts:
33,710
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.

You can post new topics in this forum