How can I compress files, with a hyphen in?

0

At present, I am responsible for keeping backups of an eCommerce's web files. My process is as follows:

  1. Make a Local Copy of Web files via FileZilla
  2. Upload Local Copy to a Cloud Storage Facility

The amount of web files, as well as their file sizes, have become so large, that not only are they taking up a substantial amount of space in the Cloud Storage facility but taking a long time to upload. As such, I tried the Zip the web files.

All was working fine, until I got to the image files. Many of the images, follow a format of:

  • file-name-example.png

As such, the default Windows Compression Tools in unable to Zip all image files, with multiple names in. This is due to the 'illegal' reference of '-'.

Renaming the local copies of the Image Files, is impracticable. Not only will this be time consuming but also cause issues, should a backup need to uploaded. Also, renaming the Product Images to be just one name could negatively affect its SEO.

Is there a way to modify Windows' Compression Tool, to accept the hyphen in file names?

Craig

Posted 2018-03-20T18:48:46.197

Reputation: 147

Surround the filenames/paths with quotes? (") – Bill Hileman – 2018-03-20T18:55:37.057

1Hyphens don't particularly sound like they'd be problematic. Are there spaces in the file names or are these hyphens from the far end on the unicode spectrum perhaps? – Mokubai – 2018-03-20T19:03:58.600

@BillHileman Renaming the files is not a viable option, as it would cause an excess amount of additional work, should a backup need be uploaded. – Craig – 2018-03-20T21:58:01.193

@Mokubai It appears you are right. I just tried Compressing some of the other image files, which also have hyphens in, and they compressed successfully. They were in the same folder directory. I have no idea what is causing these issues. I have found that if I download the file and then retype the file name, it appears to work. There are no spaces etc. Is it possible that there could be some kind of 'hidden' character in the file name? Not that I have ever heard of such a thing. – Craig – 2018-03-20T22:04:54.177

I didn't mean rename files in my suggestion, I merely meant referring to the files as "file-name.ext" instead of file-name.ext. The hyphen is typically used in command prompt commands to denote switches (options) I don't know that this is a command line procedure you're doing or not, but regardless, if you specify files on a line that also allows for hyphenated options, that might be the confusion to the application (compressor program) and often surrounding the filenames with quotes will tell the program to ignore those hyphens (not options). – Bill Hileman – 2018-03-20T23:27:54.537

@BillHileman Do you mean, to use quotes in my Question? All I have done, is downloaded an image file from the Server, using FTP. In doing so, some images are not compressible, despite having the same file name format. Absolutely clueless, why. – Craig – 2018-03-21T01:32:07.043

My suggestion does not apply in your case. I thought perhaps you were using a command line interface, based upon the error message you were reporting. Sorry I couldn't be of any help. – Bill Hileman – 2018-03-21T11:25:25.373

@BillHileman Gotcha. No worries. Thank you for your time, nonetheless. – Craig – 2018-03-21T19:59:19.827

No answers