How can I add a file/data upload picker on my form in Alfresco Share? I need to click on my button then the file picker should appear. Can anybody help?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check out the Manage Users console code defined in users.js, which features the ability to upload a CSV file containing user details.
First you need to define a HTML button control and then add some client-side script to bind that to an upload control
Define the button in your component’s HTML template
Then create the YUI button in your client-side code (e.g. in your
onReady()function)Then define the button click handler as a new function of your component’s prototype – following example is from function
ConsoleUsers_onUploadUsersClick()inusers.jswhich you will need to modify as per your needsNote the use of the
uploadURLparameter in the config object. You should set this to the URL of a custom repository web script you create that knows how to handle the contents of the uploaded file.The user upload example also defines a method
onUsersUploadComplete()that you will see referenced. It is up to you to implement your own component method here to take appropriate action such as updating the UI based on the results of the upload.