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-ico n.png" Width="131px" />
<asp:Image ID="Image3" runat="server" Height="131px" ImageUrl="~/images/Car-ico n.png" Width="131px" />
<asp:Image ID="Image4" runat="server" Height="131px" ImageUrl="~/images/Car-ico n.png" Width="131px" />
<asp:Image ID="Image5" runat="server" Height="131px" ImageUrl="~/images/Car-ico n.png" Width="131px" />
<asp:Image ID="Image6" runat="server" Height="131px" ImageUrl="~/images/Car-ico n.png" Width="131px" />
<asp:Image ID="Image7" runat="server" Height="131px" ImageUrl="~/images/Car-ico n.png" Width="131px" />
</td>
</tr>
</table>
<br />
<ajaxToolkit:AjaxFileUploa d ID="AjaxFileUpload1" runat="server" onuploadcomplete="AjaxFile Upload1_Up loadComple te" MaximumNumberOfFiles="6" Height="200px" />
<ajaxToolkit:ToolkitScript Manager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScrip tManager>
<br />
I then display the images from the server with codebehind based on Gridselection
Image2.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5 5].Text;
Image3.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5 6].Text;
Image4.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5 7].Text;
Image5.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5 8].Text;
Image6.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5 9].Text;
Image7.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[6 0].Text;
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-ico
<asp:Image ID="Image3" runat="server" Height="131px" ImageUrl="~/images/Car-ico
<asp:Image ID="Image4" runat="server" Height="131px" ImageUrl="~/images/Car-ico
<asp:Image ID="Image5" runat="server" Height="131px" ImageUrl="~/images/Car-ico
<asp:Image ID="Image6" runat="server" Height="131px" ImageUrl="~/images/Car-ico
<asp:Image ID="Image7" runat="server" Height="131px" ImageUrl="~/images/Car-ico
</td>
</tr>
</table>
<br />
<ajaxToolkit:AjaxFileUploa
<ajaxToolkit:ToolkitScript
</ajaxToolkit:ToolkitScrip
<br />
I then display the images from the server with codebehind based on Gridselection
Image2.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5
Image3.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5
Image4.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5
Image5.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5
Image6.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[5
Image7.ImageUrl = "~/SiteImages/" + vUsername + "/" + GridView1.Rows[tt].Cells[6
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good solution
You are welcome.
https://github.com/blueimp/jQuery-File-Upload/wiki
It might do what you want.