YUI Uploader: automatically open browse dialog - javascript

I'm using the YUI Uploader component and want to automatically open the browse dialog on page load so the user can choose a file without first clicking the upload button. Is this possible?
The uploader component is a Flash movie so I don't think it's possible to trigger a click on the upload button using Javascript.

You can't because since Flash 10, the upload browser can only be shown when a user explicitly click on the browse button
(this a security issue: http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_02.html#head3)

Related

upload a file in modal pop-up

I have a modal pop-up for creating users where I should be able to upload a profile photo. Is it possible to insert a file in a modal pop-up? I have tried implementing this but the "Browse" button for choosing the file cannot be clicked.
I'm working with .NET 6 Framework.
Thank you.

How to force open "Save as..." dialog on left click for downloading file from remote server

I want to open "Save as..." dialog on left click on link for file downloading from not my servers. Main idea - create link for downloading image, image getting with bad name. I want to force edit it in browser dialog, before user download it.
You really can't force a save-as dialog. Sorry.
Alternative approach
When they click a link you can use javascript to show a prompt for a better name. When they have filled in the name you can use the html5 <a download="name"> attribute to provide a link that downloads with the better name.

How to hide "open with" option at the time of downloading file using javascript?

I have small requirement for downloading the file, here I would like to hide "open with" option and "Save" should be "Save As", could you please help me,
I'm assuming this is firefox relating. I don't think it's possible to change the options you're trying to change. However you can change the download action which might be useful to yourself. Please see below
This will not affect media embedded in a web page - only links to the files themselves.
Click the menu button and choose Options
Select the Applications panel.
The Applications panel will display. Select the type of file for which you want to change the default action.
The Action column will give you a drop-down menu, with options on action to take, whenever you click that type of file.
Always ask: will prompt you to select what action you want Firefox to take when you click on that type of file. This can be useful if Firefox is automatically saving a file type or is always opening it with a certain program and you want to be asked what to do.
Save File: will always save the file to your computer using the Downloads window, whenever you click that type of file.
Open the file with an application or plugin of your choosing.
Click Ok to close the options window after making changes]
Further reading here

Show input file dialog on load?

I'm making a dialog for changing an image. Instead of having the user to click the file input field I want it to be brought up immediately. The input field is simply a:
<input type="file">
Is there a way to display it when page is loaded?
Bonus points if there is an angular way of doing it.
As described here only Internet Explorer allows for programmatic opening of the File Upload dialog.
So the short answer is no, there is no way to automatically open the File Upload dialog on page load.
The long answer that you might consider is that you can show it when the user clicks on anything.
The fact that you prefer an AngularJS solution tells us that you are writing a Single Page Application. Also, I don't think you need to show the File Upload dialog when the app first loads. You most likely need it to show after some user interaction - after the user clicks on something. That something, using the an AngularJS directive from here, could look like anything but be a file input. On click (the same user interaction) you can also switch to another route in your AngularJS app, effectively simulating a user navigating to another page and automatically presenting him the File Upload dialog.

How can I implement facebook-like avatar upload?

On facebook, if you click on edit picture, you get a menu that offers the option Upload photo. I want to implement something similar on my website. I want the browser's file upload dialog to appear once I click on Upload photo, and I'd like it to automatically be submitted once the user selects a picture. How should this be implemented?
A colleague suggested a hidden div that has with an input field of type file, and to automatically trigger the click event when the user clicks on Upload photo, and then, to listen for the change event on the file field, and submit the form using jquery. What do you think?
I would look into a file uploader plugin such as plupload. Plupload has several nice features specifically for the uploading of images such as:
Lower the quality of the image to a specific percentage of the original
Resize the image to specific dimensions if possible
Also, I am pretty sure that plupload has a built in option to automatically submit once the user has selected an image.

Categories