| | |
how to store the uploaded txt or .doc or jpg file in to webserver by dynamically
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2007
Posts: 14
Reputation:
Solved Threads: 0
how to store the uploaded txt or .doc or jpg file in to webserver by dynamically
0
#1 Jul 19th, 2007
how to create new folder for each user who uploads .doc,.txt,.png,.jpg into web server. user may select his own type of uploads file depending upon file extension new folder must be created.
eg: user wish to upload a .doc file
then i want to create dynamically
http://localhost/test/user1/doc/xyz.doc
test- name of project
user1-user name who has uploaded
doc- folder name becoz .doc file uploaded
xyz.doc- name of the file
eg: user wish to upload a .doc file
then i want to create dynamically
http://localhost/test/user1/doc/xyz.doc
test- name of project
user1-user name who has uploaded
doc- folder name becoz .doc file uploaded
xyz.doc- name of the file
Re: how to store the uploaded txt or .doc or jpg file in to webserver by dynamically
0
#2 Jul 27th, 2007
•
•
Join Date: Jun 2007
Posts: 14
Reputation:
Solved Threads: 0
Re: how to store the uploaded txt or .doc or jpg file in to webserver by dynamically
0
#3 Jul 28th, 2007
am creating new folder for each user who uploads any files. all the uploaded files will be in that folder.
here is sample
//file upload
if ((FileUpload1.PostedFile != null) && (FileUpload1.PostedFile.ContentLength > 0))
{
System.IO.Directory.CreateDirectory(Server.MapPath("Upload" + "/" + Request.Cookies["uname"].Value.ToString()));
string a;
string fn = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
SaveLocation = "Upload" + "/" + Request.Cookies["uname"].Value.ToString() + "/" + fn;
a = Server.MapPath("Upload" + "/" + Request.Cookies["uname"].Value.ToString()) + "/" + fn;
try
{
FileUpload1.PostedFile.SaveAs(a);
}
catch (Exception ex)
{
Response.Write("Error: " + ex.Message);
}
}
here above code is used to create a new folder with his name.
here is sample
//file upload
if ((FileUpload1.PostedFile != null) && (FileUpload1.PostedFile.ContentLength > 0))
{
System.IO.Directory.CreateDirectory(Server.MapPath("Upload" + "/" + Request.Cookies["uname"].Value.ToString()));
string a;
string fn = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
SaveLocation = "Upload" + "/" + Request.Cookies["uname"].Value.ToString() + "/" + fn;
a = Server.MapPath("Upload" + "/" + Request.Cookies["uname"].Value.ToString()) + "/" + fn;
try
{
FileUpload1.PostedFile.SaveAs(a);
}
catch (Exception ex)
{
Response.Write("Error: " + ex.Message);
}
}
here above code is used to create a new folder with his name.
![]() |
Similar Threads
- Processing file by file in a txt, and storing the name of the file being processed (Shell Scripting)
- Cant save as a JPG file from IE (Web Browsers)
- is it possible to change the size of jpg file through programming in vb (Visual Basic 4 / 5 / 6)
- TXT Plays like a Music File? (JavaScript / DHTML / AJAX)
- URGENT - Reading from txt file into a 2 dimension array (Java)
Other Threads in the ASP.NET Forum
- Previous Thread: Web Service
- Next Thread: How to disable tab stop on datagrid headers?
| Thread Tools | Search this Thread |
.net 2.0 ajax alltypeofvideos appliances application asp asp.net bc30451 beginner box browser button c# cac checkbox class commonfunctions control countryselector dataaccesslayer database datagridview datagridviewcheckbox datalist deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose feedback fileuploader fill findcontrol flash form formatdecimal formview gridview gudi iis image javascript listbox login microsoft mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent problem radio redirect registration relationaldatabases reportemail save schoolproject search security select sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos vista visualstudio vs2008 web webapplications webdevelopemnt webdevelopment webprogramming webservice wizard xsl youareanotmemberofthedebuggerusers





