Link to home
Start Free TrialLog in
Avatar of Zack Snyders
Zack Snyders

asked on

Custom Drag & drop file uploader

Hi Experts,
I have a requirement to create a custom file uploader in C#.

Summarised requirement is; Drag selected image onto a displayed placeholder image and upload to server.

What I am currently doing is to display a row of images and then use Ajax file uploader to upload the images that the use drags&drops into Ajax drop area. I then replace the row of images with those selected by the user.
I now need to customise this and maybe use a different approach and not Ajax.
I need to drag and drop each user selection onto the image. The image is then replaced on the fly.
Would appreciate some help

below is my current code

 <table>
         <tr>
            <td style="text-align: center; border-top: 1px solid #00FD17; border-bottom: 1px solid #00FD17; padding: 1px 4px">
                <asp:Image ID="Image2" runat="server" Height="131px" ImageUrl="~/images/Car-icon.png" Width="131px" />
                <asp:Image ID="Image3" runat="server" Height="131px" ImageUrl="~/images/Car-icon.png" Width="131px" />
                <asp:Image ID="Image4" runat="server" Height="131px" ImageUrl="~/images/Car-icon.png" Width="131px" />
                <asp:Image ID="Image5" runat="server" Height="131px" ImageUrl="~/images/Car-icon.png" Width="131px" />
                <asp:Image ID="Image6" runat="server" Height="131px" ImageUrl="~/images/Car-icon.png" Width="131px" />
                <asp:Image ID="Image7" runat="server" Height="131px" ImageUrl="~/images/Car-icon.png" Width="131px" />
            </td>
        </tr>
             </table>
            <br />  
 
 
            <ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" runat="server" onuploadcomplete="AjaxFileUpload1_UploadComplete" MaximumNumberOfFiles="6" Height="200px" />
            <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </ajaxToolkit:ToolkitScriptManager>
                    <br />

 I then display the images from the server with codebehind based on Gridselection
  Image2.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[55].Text;
            Image3.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[56].Text;
            Image4.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[57].Text;
            Image5.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[58].Text;
            Image6.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[59].Text;
            Image7.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[60].Text;
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Have you had a look at JQuery Uploader from Blue Imp?

https://github.com/blueimp/jQuery-File-Upload/wiki

It might do what you want.
Avatar of Zack Snyders
Zack Snyders

ASKER

Hi Julian,
Not quite, unless I am missing something.
The link you provided handles the file selection part and the server side processing fine but the actual part I am after is to drag an image file on to a displayed image and then in the background upload the file and replace the image that I dropped the file onto with the selected image. Trust this makes sense
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good solution
You are welcome.