I like the drag & drop feature of the skydrive file upload control. How do i go about developing a similar control?
views:
204answers:
2C# will only assist you at the sever side of this feature, most of it uses Java Script (client side) to upload the files in a pretty AJAX way (very similar to GMail attachments). You can use the following example to implement something similar to Skydrive's.
This can assist you of implementing the asynchronous upload part.
Good luck.
check my source code if it's useful
using System; using System.Data.ProviderBase; using System.Text; using System.Xml.Schema; using System.Xml.XPath; using System.Xml.Xsl; using System.Globalization; using System.Diagnostics; using System.ComponentModel.Design; using System.Data.Common; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Collections; using System.Data; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using System.Web.Security; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
}
protected void upload_Click(object sender, EventArgs e)
{
if (fileupload.HasFile) try {
fileupload.SaveAs("C:\\Uploads\\" + fileupload.FileName);
lbl.Text = "File name: " +
fileupload.PostedFile.FileName + "
" +
fileupload.PostedFile.ContentLength + " kb
" +
"Content type: " +
fileupload.PostedFile.ContentType;
}
catch (Exception ex) {
lbl.Text = "ERROR: " + ex.Message.ToString();
}
else
{
lbl.Text = "You have not specified a file.";
}
}
}
& html is
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="fileupload.aspx.cs" Inherits="_Default" %>
if my answer is good please give me vote