SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

Dynamically Change uploadStreamProvider to control the uploaded file directory and filename Options
volleyball
#1 Posted : Wednesday, March 05, 2008 4:28:55 PM
Rank: Newbie

Groups: Registered

Joined: 3/5/2008
Posts: 2
How can I dynamically change the uploadStreamProvider before upload starts to control the settings for uploadStreamProvide? I couldn't find an example on your site for this.
ChrisHynes
#2 Posted : Wednesday, March 05, 2008 7:25:36 PM
Rank: Administration


Groups:

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ
Use a FileNameGenerator to accomplish this. Check the FileNameGenerator and FileNameGeneratorVB samples -- those should get you started. Let me know if you have any other questions.
volleyball
#3 Posted : Thursday, March 06, 2008 9:31:07 AM
Rank: Newbie

Groups: Registered

Joined: 3/5/2008
Posts: 2

I did take a look at the file generator example but don't see how I can dynamically change the directory where the uploaded file will be stored. Your example shows how you can change the directory based on part of the filename within PrefixFolderFileNameGenerator.

My goal is an application that has several directories that uploaded files will be placed depending on the user. Again, I don't see how to pass the "upload to" directory from the session that initiates the upload process.

Thanks in advance for your help.

 

 

ChrisHynes
#4 Posted : Tuesday, March 11, 2008 10:04:12 AM
Rank: Administration


Groups:

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

How do you access the user? HttpContext.User.Identity.Name? Or? You should be able to access HttpContext properties inside the filename generator and use them to build the filename by using HttpContext.Current. If you need to access session properties, you'll need to add the attachEvent="PreRequestHandlerExecute" attribute to the uploadParser web.config key.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.