Button to add Upload plugin
-
Hello,
I have wp file upload pro and I wish the users can click on a button to upload another photo. This second upload field must have different parameters (like upload folder).
Is it possible ?
-
Do you mean to have a second instance of the plugin on the same page? This is possible yes.
Thanks you for your return.
Yes it’s what I mean but I want call this second instance with a button.The goal is to let the possibility to the user to upload another photo in another theme (so a different upload folder behind) during a photo competition.
So if I understand right, the second instance is not visible. When the user presses the button it shows the second instance, he selects a file and uploads it. The uploaded image goes to a different upload folder.
Correct?
Yes it’s correct !
I suppose you want the button show up when the user uploads a file with the first instance first, right?
Please put the following code inside your page manually using the page editor, below the first shortcode:
<button id="wfu_instance2_button" onclick="document.getElementById('wfu_instance2').style.display = 'block';" style="display:none;">Upload Another File</button> <div id="wfu_instance2" style="display:none;">[wordpress_file_upload uploadid="2" uploadpath="uploads/inbox2"]</div> <script type="text/javascript"> if (!window["wfu_notify_server_upload_ended_orig"]) { window["wfu_notify_server_upload_ended_orig"] = window["wfu_notify_server_upload_ended"]; wfu_notify_server_upload_ended = function(sid, unique_id, params_index, session_token) { var G = GlobalData[sid]; if (G.upload_state == 0 || G.upload_state == 1) document.getElementById("wfu_instance2_button").style.display = ""; wfu_notify_server_upload_ended_orig(sid, unique_id, params_index, session_token); } } </script>
Set the uploadpath attribute of the second shortcode to the one you want.
Update the page. You will not see any button or second upload instance at the beginning. When a file is uploaded, the button “Upload Another File” will show up. If the user presses it, the second upload form will show up.
Regards
Nickolas
Hello,
It works !! Thank you very much 🙂
Do you know how I can line breaks between the different fields of an instance?
Regards,
Quentin- This reply was modified 7 years, 3 months ago by quentin77860.
please send me the URL of the page to check.
Nickolas
I do not see the upload form, do I have to be logged in?
Sorry, you must be logged in. You can log on this page https://pixyourcampus.com/login with this credentials: toto and password: toto
Hi, please put the following css code inside the Custom CSS area of the visual editor of the plugin:
div#userdata_1_1 { height: 280px !important; } div#wordpress_file_upload_block_1 tr { border: none; } div#wordpress_file_upload_textbox_1 { margin-bottom: 6px; } div#wordpress_file_upload_filelist_1 { margin-top: 6px; }
This will result to some changes. Let me know if this is what you want.
Regards
Nickolas
Hello,
Thanks for the css code, it works very well !
I am really sorry and ask you a lot but I wanted to know if it is possible to put a drop down list and following the choice change the destination folder of the upload ?
Best regards,
Quentin.- This reply was modified 7 years, 3 months ago by quentin77860.
Hi, yes this is the subfolder feature. The Upload Path option defines the topmost folder. Then, using the visual editor you define a list of subfolders below the topmost folder. The user will be prompted to select a subfolder from the dropdown list. Then the files will be uploaded to that subfolder.
Try it and let me know if you have any problems.
Nickolas
Hello,
Thank you for your answer 🙂
Just one final question, as you can see, I use additional data fields and one field with multiple lines text (label : “Description de votre photo”).
My problem is that when you want to write, it starts in the middle of the field… Do you have an idea to solve this ?And is it possible to remove the text “(requis)” from the title of the field while leaving the required box in the parameters of the instance?
Best regards,
Quentin.yes of course, here it is and also for the requis text:
textarea#userdata_1_field_1 { padding: 10px; height: 200px; } label#userdata_1_label_1:after { content: ''; }
Nickolas
- The topic ‘Button to add Upload plugin’ is closed to new replies.