how to get full path of upload file?

how to get full path of upload file ?

Upload fileUpload = new Upload(“File Upload”);

brouse button click and file select and open button click then upload componets in all path available
it path how to get?

You cannot unless the browser is broken. The path where the file came from is not part of the file upload protocol. I think some have created javascript hacks (on submit, getting the full path from the input type=“file” element and storing it in a hidden form field so it’s transferred too), but it’s not normally available to leak client side details.

Indeed, the upload protocol specifies that implementations should not provide that information, although some versions of IE do.

This is not really a Vaadin issue but a generic one - as I wrote elsewhere, you need some kind of a native browser plug-in for this, and that is not trivial to implement for every browser (nor to maintain as e.g. Firefox SDK keeps changing in every version). If you don’t find a plug-in made by others for this, I would think very carefully about alternative approaches before putting a lot of time to implement this yourself.

If you find somewhere a suitable plug-in, you still need a wrapper to integrate it with Vaadin, including a custom client side widget. If you manage to do this with Flash (i.e. if Flash does not restrict this too much because of the same security concerns), that would cut down the maintenance effort significantly and there are already some examples of how to integrate a Flash component with Vaadin.


I am uploading image to AWS server S3.

I want to write the path dynamically instead of writing manually,

Please find the below class.

Instead of String path = “G:/”; i want to get the path of user PC. How would i get it as it is required for path, else, error occurs, no such file exits on the path.

Please Help

public class ImageUploader implements Receiver{

private File file;
public OutputStream receiveUpload(String filename, String mimeType) {
    FileOutputStream fos = null;
    String path = "G:/"; 
    file = new File(path + filename);
    AmazonS3Example AWSS3 = new AmazonS3Example();
    try {
        fos = new FileOutputStream(file);
    } catch (final e) {
        new Notification("Could not open file<br/>",e.getMessage(),Notification.Type.ERROR_MESSAGE).show(Page.getCurrent());
        return null;
    return fos;