Hello
I want to upload file on the server using form, how can I do it. I want to allow max. 2 MB files to be uploaded so please help me regarding this.
Thank you
Hello
I want to upload file on the server using form, how can I do it. I want to allow max. 2 MB files to be uploaded so please help me regarding this.
Thank you
You can use following code for uploading file to the server.
make sure that you have a write permission set to the folderPHP Code:String fname = file1.PostedFile.FileName;
string path= Server.Mappath("./images/");
file1.PostedFile.Saveas(path);
donald (05-06-2009), nikon (01-29-2009), viraj_zaveri (05-02-2009)
I want to show a perfect logo gor the company in its website. So please help me out...
Also tell me the code for the upload of the images if i had sored whole path of the image in the database table...
uploding file means that you can upload any image from the database and show on your project
For uploading file on the server you need appropriate permission to write content in the location. [ Host_Name\ ASPNET ] user must have the permission in the specified folder.
Code:
private void Button1_Click(object sender, System.EventArgs e)
{
if((this.file1.PostedFile !=null) && (this.file1.PostedFile.ContentLength >0))
{
try
{
string FileName=System.IO.Path.GetFileName(file1.PostedFi le.FileName);
string SaveLocation=Server.MapPath("Data") + "\\" + FileName;
this.file1.PostedFile.SaveAs(SaveLocation);
Response.Write("File Uploaded !");
}
catch(Exception Ex)
{
Response.Write(Ex.Message);
}
}
}
is it possible to upload multiple files with the asp.net and single file component? I want comma seperated one
You need an FTP client, use WS_FTP, you must configure it with the information provided by your server owner, as domain name, administrator and password... don't worry, it's easy...
Bookmarks