Aurigma Forums
»
Upload Suite
»
Discussions – ActiveX/Java Uploader
»
Image Reorder on client and sequence of upload rename
Rank: Member
Groups: Member
Joined: 7/9/2007(UTC) Posts: 2
|
Hi I'm using asp.net c#, Uploader 4.0 Dual
I’m selecting multiple image files for upload, as per the example “Robust Upload” I have 2 questions:
1. When I reorder the images on the client side and then press upload is this the order inwhich the images are uploaded or are they uploaded in the order inwhich they were selected?
2. I want to rename the images are they are uploaded eg I want to add a “sequence number” to the file name, could anyone give some pointers on how this can be done. Eg the first img uploaded will be renamed... MyImg_01.jpg etc
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Joined: 8/3/2003(UTC) Posts: 998
|
Hello, Sorry for the long delay. 1. The files are uploaded in the same order as you see them in upload list so if you reorder them, the result sequence will be reordered too. 2. Here is a sample code: Code://Iterate through uploaded data and save the original file, thumbnail, and description.
for (int i = 1; i <= fileCount; i++)
{
//Get source file and save it to disk.
HttpPostedFile sourceFile = Request.Files["SourceFile_" + i];
string fileName = i;//GetSafeFileName(Path.GetFileName(sourceFile.FileName));
sourceFile.SaveAs(Server.MapPath(galleryPath + fileName));
//Get first thumbnail (the single thumbnail in this code sample) and save it to disk.
HttpPostedFile thumbnail1File = Request.Files["Thumbnail1_" + i];
thumbnail1File.SaveAs(Server.MapPath(galleryPath + "Thumbnails/" + fileName + ".jpg"));
//Save file info.
XmlElement xmlFile = descriptions.CreateElement("file");
xmlFile.SetAttribute("name", fileName);
xmlFile.SetAttribute("width", Request.Form["Width_" + i]);
xmlFile.SetAttribute("height", Request.Form["Height_" + i]);
xmlFile.SetAttribute("description", Request.Form["Description_" + i]);
descriptions.DocumentElement.AppendChild(xmlFile);
}
Edited by user Friday, February 22, 2008 10:44:30 PM(UTC)
| Reason: Not specified |
|
|
|
|
Aurigma Forums
»
Upload Suite
»
Discussions – ActiveX/Java Uploader
»
Image Reorder on client and sequence of upload rename
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.