Mandar Jogalekar
Mandar Jogalekar

Reputation: 3281

gmail style file upload in c#

I need to implement Gmail style file upload in asp.net c# where user will click on button and file dialog will open. user selects a file,then process that file in code. i dont want user to see file upload control he ll just click one button. i have already used few solutions
example

 function OpenFileUpload() {

        var myFrame = document.getElementById('frameUpload');
        $(myFrame).focus();
        $(myFrame).contents().find("#FileUpload1").click();

        var value = $(myFrame).contents().find("#FileUpload1").val();
        if (value != '') {
            $(myFrame).contents().find("#btnSubmit").click();

        }


    }

need better solutions.

Upvotes: 0

Views: 3239

Answers (2)

Stelian Matei
Stelian Matei

Reputation: 11623

You could try something like swfupload http://swfupload.org/

Like in Gmail case, it supports opening a file dialog by clicking on a link/button, it supports MULTIPLE selection of files and also can display the progress bar uploading the file.

Most of SWFUpload documentation uses PHP on the server side. Here is one example for ASP.NET ( SWFUpload ASP.Net example site not working? ).

Please note that to support multiple selection of files to upload from a single window, this requires Flash, it cannot be done with standard input files.

Upvotes: 1

silverfighter
silverfighter

Reputation: 6882

I am not sure if you are talking about the server or client side....

File upload with large files is a interesting topic on it's own =)...especially large files...

find good articles here: http://www.hanselman.com/blog/ABackToBasicsCaseStudyImplementingHTTPFileUploadWithASPNETMVCIncludingTestsAndMocks.aspx

http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx http://msdn.microsoft.com/en-us/library/aa479405.aspx

But why not use a convenient tool...

Here is good component:... http://www.plupload.com/

HTH

Upvotes: 3

Related Questions