|
|
Rank: Newbie
Groups: Registered
Joined: 4/30/2010 Posts: 6
|
Sorry if this has already been covered...
I would like to just add a pre-determined value to a file name just before the extension prior to upload. i.e. user is uploading a file called myFile.jpg, the file would actually upload as myFile012345.jpg. Is there documentation on how to do this somewhere? Is it even possible? TIA
|
|
|
Rank: Administration

Groups: Administrators
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
What are you basing the value on? Typically, the best way to customize a filename is to use a FileNameGenerator class (see the FileNameGenerator sample).
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/30/2010 Posts: 6
|
The value is based on a unique value generated earlier in the application.
|
|
|
Rank: Administration

Groups: Administrators
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
Are you using session state in your application? If so, you could drop the value in session when you generate it, and retrieve it in the FileNameGenerator (HttpContext.Current.Session).
If you're not using session state, you can pass the value on the query string (setting the UploadUrl property to "~/SlickUpload.axd?key=value" and retrieve it via HttpContext.Current.Request.QueryString["key"] in the FileNameGenerator.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/30/2010 Posts: 6
|
No, I'm not. I'm generating the number on the page load of the same form the upload control is on. I'm trying to use the FileNameGenerator and am getting:
Could not instantiate file name generator
Essentially all I have done though is change the config to match the sample and changed the UploadURL location to also match the sample. Obviously I'm missing some pieces here.
|
|
|
Rank: Administration

Groups: Administrators
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
The FileNameGenerator needs to be a class that implements IFileNameGenerator. Also, follow the class reference syntax here: http://krystalware.com/Products/SlickUpload/Documentation/concepts/assembly-reference.aspx. If you still can't get the reference working, email me your FileNameGenerator class and web.config and I'll take a look. chrish at krystalware dot com.
|
|
|
|
Guest |