multiple upload images on c#/jquery

后端 未结 4 1147
旧巷少年郎
旧巷少年郎 2020-12-21 11:47

is there out there any multiple upload images easy to users to upload images like the activex file uploader on facebook.

but free :)

i update my questions i

相关标签:
4条回答
  • 2020-12-21 12:31

    Actually, It is done with Flash. There are a plenty of solutions on the internet. here is one from codeproject.

    0 讨论(0)
  • 2020-12-21 12:32

    I used the library located at http://www.codeproject.com/KB/aspnet/FlashUpload.aspx for my project. It's pretty lightweight and lends itself well to modification.

    Basically, it's a multi-file uploader written in Flex. It's straightforward enough that you can also bust open the code and make changes if you need to.

    0 讨论(0)
  • 2020-12-21 12:34

    I've successfully used Uploadify with ASP.NET MVC to create a multi-file upload script with automatic image previews all inline with AJAX. One thing to keep in mind if you use Session variables in your upload action being hit by SWFUpload/Uploadify is that Flash gets its own SessionID and anything placed in the Session after a Flash upload request is placed in the Flash Session.

    0 讨论(0)
  • 2020-12-21 12:39

    Try using uplodify. It uses flash as well, and I highly recommend it. It is a highly customizeable and free product.

    For posting to another page after uploading all files:

    Make 3 hidden fields like so:

    <asp:HiddenField runat="server" ID="hdf_UserID" name="hdf_UserID"  />
    <asp:HiddenField runat="server" ID="hdf_AlbumID" name="hdf_AlbumID" />
    <asp:HiddenField runat="server" ID="hdf_ImageFiles" name="hdf_ImageFiles" />
    

    and here is how you set up your button to post to the second page:

    <asp:Button runat="server" ID="btn_Submit" PostBackUrl="YourPage.aspx" />
    

    Once on the second page you can grab the information out of the request like so:

    Request["hdf_UserID"].ToString()
    Request["hdf_AlbumID"].ToString()
    Request["hdf_ImageFiles"].ToString()
    

    you can store all the files in the hidden field and I would recommend | delimited then you can just do a .split on the other page

    For the .ahx page of the uploadify uploader:

    using the scriptData option you can pass information to the second page.

     var auth = "<% = Request.Cookies[FormsAuthentication.FormsCookieName]==null ? string.Empty : Request.Cookies[FormsAuthentication.FormsCookieName].Value %>"
     var user = $('[id$=hdf_UserID]').val();
     var album = $('[id$=hdf_AlbumID]').val();
    
     $('[id$=fileInput]').uploadify({
            'uploader': '../Uploadify/uploadify.swf',
            'script': '../Uploadify/Upload2.ashx',
            'scriptData': {'Token': auth, 'User': user, 'Album': album},
    

    in the .ashx of uploadify you can get the scriptData by the following:

    string user = context.Request["User"];
    string album = context.Request["Album"];
    

    This code is uploadify specific but hopefully it will help you understand yours

    0 讨论(0)
提交回复
热议问题