FTP upload of filename with space on the end

I’m not sure if this is a bug or just a gotcha but it seems inconsistent so I’ll raise it here.

I had a ftp upload action where the RemoteFile parameter had a space at the end.

The upload operation succeeded i.e. the space was trimmed from the LocalPath + RemoteFile (i.e. source path) and found in the Windows filesystem but the space was not trimmed from the RemotePath + RemoteFile (i.e. destination path) thus ending up with a file with a space on the end at the destination ftp site (a Linux box).

This proved to be quite tricky to figure out since we could see two files apparently with the same name on the ftp site and any FtpZilla attempts at delete and rename failed as they didn’t cope with the space at the end.

I wasn’t aware that Linux file systems would let you have files with spaces on the end.

If the ftp upload had been consistent in its treatment of paths (i.e. trimming both or trimming neither) this would have been a lot easier to resolve.

If it failed to find the source file on Windows due to the presence of the space, that would have pointed us at the problem a lot sooner.

But I think trimming the upload path as well is probably the least surprising behavior since files with spaces on the end are damnably difficult to figure out and confuse lots of tools.

Cheers,
Paul.

Hi Paul

I guess this not so much a bug as it is a gotcha, Finalbuilder has no idea what the remote file system/os is, and it’s just uploading to the remote file as requested. Since I can’t think of a good reason why anyone would want spaces at the end of a filename, I had added trimming of the RemoteFile property before the upload begins. If you need a build with this change let me know, otherwise it will be in the next update.

Hi Vince

Yeah - it’s a really peculiar case.

But I agree that file names with spaces on the end are a damn pain to deal with and I can’t think of any valid reason why you’d want one. I was copy and pasting the file name from an email which is probably how the space got in there without me noticing.

As an aside, it does somewhat remind me of the old Unix gotcha of creating a file named ‘* -R’ to trick novices who’d try to delete it without knowing to use a shell escape and blow away their entire home directory.

Anyway, I’ve removed the unintended space so I don’t need an interim build.

Cheers,
Paul.