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

Notification

Icon
Error

Options
Go to last post Go to first unread
Jyotindra  
#1 Posted : Sunday, June 29, 2008 11:20:33 PM(UTC)
Jyotindra

Rank: Newbie

Groups: Member
Joined: 6/29/2008(UTC)
Posts: 7

Hi,

How can i save files outside virtual directory on server side.
For example "C:/Temp"

Is it possible ?

Thanks,
Jyo
Fedor  
#2 Posted : Monday, June 30, 2008 2:05:26 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hello Jyo,

Image Uploader is just client-side browser component which upload files to server. You can configure server-side upload script to save at any location you want.

For example if you use ASP.NET then you can just modify sample upload.aspx file from:

Code:
//....
//Get source file and save it to disk.
HttpPostedFile sourceFile = Request.Files["SourceFile_" + i];
string fileName = GetSafeFileName(Path.GetFileName(sourceFile.FileName));
sourceFile.SaveAs(Server.MapPath(galleryPath + fileName));
//....


to

Code:
//....
//Get source file and save it to disk.
HttpPostedFile sourceFile = Request.Files["SourceFile_" + i];
string fileName = GetSafeFileName(Path.GetFileName(sourceFile.FileName));
sourceFile.SaveAs(@"c:\temp\" + fileName);
//....
Best regards,
Fedor Skvortsov
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.