Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Uploading to more than one directory?
Old 02-12-2008, 04:08 AM Re: Uploading to more than one directory?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Any help to alternate the uploads to Input and then Input2, would be appreciated. Thanks.
More input, need more input. (sorry watched Short Circuit over the weekend with the kids )

Are you uploading several files at once or uploading one file at a time?

Does it need to save state so if the user looses connection or returns to upload more the next file is put in the right place.

Is this an image uploader with thumbnail and main image arrangement? Because I coded a way around needing seperate folders for this setup by using prefixes or suffixes for the filenames to identify the thumbs from the main when I started rewriting one application.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
 
Register now for full access!
Old 02-12-2008, 10:24 AM Re: Uploading to more than one directory?
Extreme Talker

Posts: 216
Trades: 0
Thank you for your reply.

It is set up to upload one file at a time.

Quote:
Does it need to save state so if the user looses connection or returns to upload more the next file is put in the right place.
I'm not really clear on what you mean here. But, there is no "right place". When a file arrives (by upload) into a directory A, it is grabbed and processed. I'm simply trying to split up the load on a single directory, so files can be grabbed simultaneously from directory A & directory B, so as to speed up the processing time.

No images are uploaded.

Thanks. I look forward to your reply.
chrisj is offline
Reply With Quote
View Public Profile
 
Old 02-12-2008, 10:45 AM Re: Uploading to more than one directory?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
so files can be grabbed simultaneously from directory A & directory B, so as to speed up the processing time.
Processing time of what? Because you could be wasting your time totally even bothering about this.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-12-2008, 01:27 PM Re: Uploading to more than one directory?
Extreme Talker

Posts: 216
Trades: 0
Thanks for your reply.

The upload script uploads to a directory and the files in the directory get grabbed and automatically translated, using another type of script. So, instead of translating one file at a time , the script will be processing two files at a time, thus speeding up the translation processing time, if I can get files uploaded to seperate alternate folders, via the freeASP upload script.

Last edited by chrisj; 02-12-2008 at 01:29 PM..
chrisj is offline
Reply With Quote
View Public Profile
 
Old 02-12-2008, 04:31 PM Re: Uploading to more than one directory?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Do you need to log uploads, or is there any value?

What you need is a mechanism for knowing whether the last file went into your A or B folder. Although it sounds like a much better idea would be to count how many files (or bytes?) are in each folder when an upload completes, and then send the new file into the smaller folder??
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 02-12-2008, 07:11 PM Re: Uploading to more than one directory?
Extreme Talker

Posts: 216
Trades: 0
Logging uploads is not neccessary.

I don't even neccessarily need to know "whether the last file went into your A or B folder". If this upload goes to Input, the next one should go to Input2, then the next one should go to Input, then the next one goes to Input2, etc.

Yes, counting which has the smallest amount would be good, though more complex than i'm looking for. I'm just wondering if it can upload to one place then another.

thanks again.
chrisj is offline
Reply With Quote
View Public Profile
 
Old 02-12-2008, 07:58 PM Re: Uploading to more than one directory?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
It can be uploaded to one place and then a different place next time, and then circle around to an infinite loop. In fact there are many ways to accomplish this task - which is what these questions are on about. Trying to narrow it down from 100s of choices to 1.

Believe it or not, figuring out which directory has less stuff in it might be less complex to code than going A, B, A, B, A, B, A, B, A, B, A, B, A, B, A, B, A, B, A, B and so on. The reason is because to do that, you need to know the last place you saved the file. And to do that, we need some kind of logging or a different mechanism.

If you keep a log of uploads, you can store things (that you don't seem concerned over) like the user name and IP Address. Along with this information you can store what directory the file went into. Then, after somebody uploads a file, your ASP code would check the log, pulling up the most recent entry to find what directory that file was saved to - and then write to the other directory.

Instead of writing this information to a database table, you could use a flat file. In fact you could write ONLY the name of hte last directory you used. That would take less work to code - at least at first blush. Because you've got a server app, it's possible two people could save a file at the same time, then you have locking issues with the file. So I wouldn't recommend that route.

You've already seen how you can create a variable, "hard code" it to C:\Input2 and then have everything go there. Instead, you need a more intelligent way to put the correct folder name in that variable right before you save the file. It could be by logging. It could be some other means. It could be by running a count of the files in each directory and returning the one with the least stuff in it.

I'd probably go with the last because (1) if you don't need a log this way is the least work for the most payoff and (2) if you're using 2 directories for load balancing, this will get you better balance.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 02-12-2008, 08:09 PM Re: Uploading to more than one directory?
Extreme Talker

Posts: 216
Trades: 0
Thank you for your thoughts on this. I really appreciate it. I would be happy with a simplistic scenario.

I'm interested in "the least work for the most payoff and (2) if you're using 2 directories for load balancing, this will get you better balance", but I don't know where to go from here. Can you provide some guidance, please?

thanks.
chrisj is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Uploading to more than one directory?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43287 seconds with 11 queries