Flash 8 FileReferenceList - upload script for .NET
Posted
Saturday, August 20, 2005 2:17 PM
by
Shunjie
The below is the codes to save the files uploaded from Flash 8's FileReferenceList, using asp.net 1.1
/*C# .NET */
string saveToFolder = "savedFiles"
private void Page_Load(object sender, System.EventArgs e)
{
HttpFileCollection uploadedFiles = Request.Files;
string Path = Server.MapPath(saveToFolder);
for(int i = 0 ; i < uploadedFiles.Count ; i++)
{
HttpPostedFile F = uploadedFiles[i];
if(uploadedFiles[i] != null &&
F.ContentLength > 0)
{
string newName =
F.FileName.Substring(F.FileName.LastIndexOf("\\") + 1);
F.SaveAs(Path + "/" + newName);
}
}
}
Its actually very simple as it is just a normal uploading of files.