Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Automatically create non-existing, nested folders from upload list.

OK, I see.

Though there's no other solution.

Either create the folders, or use the synchronization.
Registry_Editor

Re: Automatically create non-existing, nested folders from upload list.

martin wrote:

Cannot you use synchronization like this?

synchronize remote "C:\files\*" "/docs/"


Hi Martin, thanks for the response.

I currently do use the synchronize function but because the amount of files and folders is so large this takes a very long time (1-2 hours every day) and puts unnecessary load on the server. The file generator outputs a list of modified files each time it runs so I am trying to switch over to just uploading the modified files, rather than having to run synchronize for two hours every day.

Kind regards,

RegEd
martin

Re: Automatically create non-existing, nested folders from upload list.

Cannot you use synchronization like this?

synchronize remote "C:\files\*" "/docs/"
Registry_Editor

Automatically create non-existing, nested folders from upload list.

Good afternoon,

I'm trying to write a script to help me upload daily generated content to my server.

We're talking sometimes thousands of individual files each day, arranged like this:

example.com/docs/1/1/2/4/1/2/1/abc.txt
example.com/docs/1/2/2/3/1/3/1/def.txt
example.com/docs/1/1/1/2/3/2/1/4/1/ghi.txt
example.com/docs/1/3/2/1/1/2/3/3/2/3/1/1/jkl.txt


Mostly the folders already exist, however each time the files are generated there is the possibility for additional folders also to be generated. So I need my script to create the folder for each file if it does not already exist.

I made the foolish assumption that

put "C:\files\1\1\2\4\1\2\1\abc.txt" "example.com/docs/1/1/2/4/1/2/1/abc.txt"


would create any directory that didn't already exist and then upload the file to it. I don't see why this is not possible?

To recursively scan each directory to discover if a particular location already exists coupled with the requisite string manipulation to create said folders is starting to sound like an awful lot of work for what should surely be a simple, automatic operation.

Many thanks in advance,

RegEd