Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
ricc  
#1 Posted : Monday, July 9, 2007 1:02:59 AM(UTC)
ricc

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

Alex Makhov  
#2 Posted : Thursday, July 12, 2007 12:47:59 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
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

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
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.