Intermittent instances of 0 byte file downloads - windows

I've been having issues lately with a VBScript that will download files from an FTP server. It's been working ok for some years, but recently it's been downloading 0-byte files, they're just empty. This should never be the case.
In troubleshooting, I tried downloading a batch of files using the FTP command in CMD, and a different set of files were downloaded that were 0 bytes. (Btw, this is why I didn't add WINSCP and VBScript tags). Upon re-attempting the download of these empty files, I notice they download ok without issue, they come with data. What could be the issue here? What else can I try? Specifically, while keeping the OS, as I do not really have control over this.
Thanks.

I wrapped the download code into a loop, and in each iteration confirmed the file's existence and size by calling a function, and passing it the filename. Doing this allows me to log more and see that the 0-byte downloads happen more often than I thought.

Related

The operation can’t be completed because an unexpected error occurred (error code -50)

I was trying to copy a bunch of files from my iMac to my My Passport wifi drive. A certain folder kept failing. I rebooted, ran Disk Utility using a different mac, tried connecting directly (drive didn't show up!).
Since I couldn't find the answer by searching, I decided to post my solution now that I have solved it.
A few of the pdf files in my folder (saved from emails) had been named using the '/' character. The Mac had no problem saving these files locally. Obviously, that character represents a path in unix/linux/mac systems and so it probably was originally named on a Windoze machine.
Solution: After removing the '/' in the filenames, all copy operations completed successfully.

Only upload the latest folder to FTP (Local -> Remote)

I need to be able to upload a local folder (created daily) to a remote FTP everyday.
I’ve messed with WinSCP file masks (i.e. put -filemask="*>=today" C:\local\ /) and ran into issues where it would upload the latest folder (contained subfiles) but it would also upload the rest of the folders in the directory. (they were empty) I then realized filemasks only works specifically for files, not folders.
I then came across this thread: Download files newer than X days from SFTP server with WinSCP, skipping folders that do not contain any matching files
User had the same issue except he was going Remote -> Local whereas I need the opposite, solution was to use PowerShell
Considering that thread is a couple years old, does WinSCP scripting now support such a feature? Unfortunately I’m a bit of a novice with PowerShell.
Thanks for your time.
WinSCP does not support time constraints for folders.
But what has changed (since the other question) is that now you can prevent WinSCP from creating the empty folders. Use -rawtransfersettings switch with ExcludeEmptyDirectories setting.
put -rawtransfersettings ExcludeEmptyDirectories=1 -filemask="*>=today" C:\local\ /
If you really need to upload the latest folder (as opposite to uploading the folder with the latest files), using WinSCP .NET assembly from your favourite language (like PowerShell) is still the way to go, as shown in the other question.

Filezilla not updating files

I made a modification in a php file and uploaded it via Filezilla. It always worked fine for me, even if sometimes it would not upload immediately. This time, however, it's not working anymore in any way. I upload the file with the same name and it looks like it overwrites the old one, but the size of the file doesn't change. When I open the site on the browser (I've been testing in Chrome and Firefox and already cleaned their caches many times since then, and still nothing happens) and look at the source code, it shows the new code with the modification, but even so the site is still the same old one. When I open the file directly from Filezilla it also shows the modified file, but the file size doesn't change. It started yesterday, before the upgrading to version 3.7.3. It's updated now, but the files are still not being updated. I also tried renaming the file, deleting it from the ftp and uploading again, uploading it to another folder and then moving it to the root, but nothing happens. Any idea of what can be causing this?
It turns out it was a problem with the permissions with the host. I contacted them and the issue was solved.

Filezilla removes line breaks on php files [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I stop Filezilla changing my linebreaks?
For some reason Filezilla sometimes removes line breaks on my php files making the code appear on a single line giving me a bunch of errors when I upload my projects, I was looking around and changed my transfer type to Binary but I still have the same issues, downloaded CuteFTP as well but same problem.
Does anyone know what can I do to fix this?
Thanks in advance!
EDIT: Now that I check, when I upload the files to my hosting they look in one line as well, but it doesn't give me any errors, the problem is when I upload to my clients host, could it be some configuration on the hosting or something?
change the "Transfer" to "Binary" (Do not keep it as a "Auto"). Restart Filezilla and upload files as it is.
Well, I managed to solve my problem, I dont exactly know how I just deleted the folder, uploaded as ASCII again, changed to Binari, restarted Filezilla, deleted the files again, and re-upload it as Binari again. For some reason it works now, maybe you have to restart Filezilla to apply the changes correctly.
Sounds like it may not be the FTP that is entirely the issue. If you're saving these files using the wrong encoding, this undesired result can be achieved. What program are you saving these files in?
If you have a file on the server in question that is formatted properly, download it with the FTP programs, then upload it without re-saving it. Check the downloaded copies and the uploaded copies to see if the issue is still occurring.

How do I schedule for all the files of one folder to be moved to another server?

I did a quick search and couldn't see anything that was relevant which I found strange as this seems like it'd be a common question. Maybe I'm just going the wrong way about it or being thick? Who knows.
Anyway, I am trying to set up a scheduled task that moves all the files in a folder from Server A to a folder in Server B. If this was a simple matter of copying them it would be fine as I'd already got that working using Core FTP and a batch file but I'd like them to be removed from Server A after the copy has taken place.
I was looking at the windows ftp commands but although I managed to log onto Server A successfully from Server B whenever I tried to do a command it just took a very long time and then disconnected.
Any help in this would be appreciated, I need it to be a schedule-able file but it doesn't matter whether it is a .bat, .vbs or anything else that I haven't though of?
Thanks,
Harry
You could use www.Dropbox.com
Why? For stability. Any home-brew ftp script that moves files, is prone to an undetected error in transmission, resulting in deleted files.

Resources