-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Url Dynamically #71
Comments
Which options you want to change? You construct the URL yourself when uploading via iframe or sendTo so you don't have to change drop zone options for that. |
1. Thank you for your response.
2. I have reviewed many such controls, and I think this one is really well done, useful.
3. My use case is the following:
* When the page is loaded, I init the control, i.e. $(“#dropZone”).filedrop({ url: ‘https://www.abc.com/FileUpload?projectId=OldValue’, etc.});
* Later, as the user clicks different controls in the page, I want to change the url that the filedrop control posts to, i.e. the additional values of the querystring, the metadata that goes with the file.
* For some reason, when I call the same js control, i.e. $(“#dropZone”).filedrop({ url: ‘https://www.abc.com/FileUpload?projectId=NewValue’, etc.}) the click/file picker dialog acts irradically, re-popping up again and again even after I select a file to upload. The drag and drop seems to still work.
So, what I would like to do is add a SetUrl(url) interface on the filedrop control, so that I can change the url at will from js without having to re-init the control,
like $(“#dropZone”).SetUrl(‘https://www.abc.com/FileUpload?projectId=value5’). But maybe you have a better solution.
[cid:[email protected]]
[cid:[email protected]]
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
…________________________________
From: Pavel <[email protected]>
Sent: Friday, July 13, 2018 2:38:23 PM
To: ProgerXP/FileDrop
Cc: Michael Z; Author
Subject: Re: [ProgerXP/FileDrop] Change Url Dynamically (#71)
Which options you want to change? You construct the URL yourself when uploading via iframe or sendTo so you don't have to change drop zone options for that.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#71 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGwlr5PgfUE19U8V1wQET9vmdFKBYNbrks5uGOkfgaJpZM4VOW5R>.
|
You are doing it wrong. FileDrop has no option If you are using iframe and want to change its url, then just change it: Or since you're using jQuery: Also, it seems you are not using FileDrop correctly. As with any other jQuery plugin, you only initialize the control once. You don't need to call |
Would like the ability to change options even after the .filedrop({}) has been called. For example, based on user input, I would like to change the Url that it uploads to, dynamically, many times while on the same page where it was initiated.
By changing the Url, I am able to change the parameters of the upload, i.e. additional parameters that tell the server function how to store the file.
If you would like, I can do a pull request, but I would appreciate a hint as to how to do this with your code. I was thinking of simply adding a .SetUrl() public function.
The text was updated successfully, but these errors were encountered: