Edit AllPages

I am using the CurlHandle framework to upload files through FTP. The one problem I am having is that I cannot upload files that contain spaces in the name. Anybody know how to fix this?

The only solution I could find is renaming the files by replacing the spaces with underscores. If it successful or fails I just rename it back to the original filename. Anybody has any other solutions?