|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/27/2005 Posts: 35
|
Hi Chris. Is it possible to add query string variables to the uploadHandlerUrl with JS? We have other elements on the page whose values are necessary to determine the storage location. Is there an event that fires before an upload starts where we could modify uploadHandlerUrl in this way? I know about the Data array, but that appears to put the values into form variables. We have always used query string variables in the GetServerFileName override to help setup the storage location, as form variables are never guaranteed.
Thanks.
|
|
|
Rank: Administration

Groups: Administrators
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
Changing the uploadHandlerUrl isn't currently supported. You can set it once when the control initializes, but it's used for both uploading and progress requests so changing it midstream could get complex.
I know you mentioned the Data dictionary, and yes, it's sent in a form variable. Have you had issues with it? I'm not aware of any situation where a form variable wouldn't be passed along with a request. That is our recommended solution currently.
If there's an issue with using the Data dictionary, I can look into what it would take to make the uploadHandlerUrl configurable.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/27/2005 Posts: 35
|
From past versions of SU, it has been discouraged to assume Form variables would be available at any particular time. I know they "should" appear in the collection before the file bits in the post, but if I need the values in GetServerFileName (from a class that uses FileUploadStreamProvider) is it wise to use Request.Form and/or SlickUploadContext.CurrentUploadSession.Data to get them?
I wonder if a SlickUploadContext.CurrentUploadSession.QSData would be a lot of work. Maybe on the client, each key put in .set_QSData is appended with a special string or something that marks it as a QSData key on the server. Just a little daydreaming there. If the Data dictionary is "safe" for this purpose, I could go with that. But it might require me to make separate code for our UploadHandler.uplx version (a different thread in this forum).
Thanks.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/27/2005 Posts: 35
|
I probably should have typed it as file.UploadRequest.Data. Anyway, if the Data collection is the safe way to do it, I wonder if we could inject query string values into it from UploadHandler.uplx. I'm trying to avoid code duplication (Data collection vs. query string) but whatever -- the client upload control is way cool either way.
I suppose one easy solution is to use a utility function and check them both. Probably a good idea anyway so there aren't a bunch of Request.QueryString calls all over the place.
Thanks.
|
|
|
Rank: Administration

Groups: Administrators
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
That's what I would suggest.
In previous versions, SlickUpload was submitting the entire form, with files and other inputs piecemeal, so there was no control over the order. In SlickUpload 6, each file is submitted separately, in its own form (or using the HTML5 File API if supported), so we have control over the input ordering.
Let me know if this works for you.
|
|
|
|
Guest |