0

I have hundreds of .txt files that need to be processed into a Rails db. This SO question talks about uploading and processing a single file, but I don't want to do that hundreds of times. Is there a way to upload a folder, then process each file within that folder?

Community
  • 1
  • 1
Mirror318
  • 11,875
  • 14
  • 64
  • 106

1 Answers1

0

As far as I know HTML5 Uploader supports uploading a directory but only Chrome has it implemented.
example HTML5 Uploader

If you are the only one doing the uploading, I would zip the file and handle unzipping it and iterating through the files on the Rails side. Note: if this will be a public interfece, you will have to be careful about sanitizing file names to prevent directory traversal attacks (e.g. '~/.ssh/authorized_keys').

jpgeek
  • 4,991
  • 2
  • 28
  • 26