Hello All,
I am using FileUpload which is in cell of table. I am selecting file from local drive but when I click on Submit Button it shows no file. That is HasFile=false always.
I have one Update Panel in my page but FileUpload Control is out side of UpdatePanel.
I am also want that Multiple Files and attach it from another form. Like yahoo file attachment process.
How can I do that.
Please help me.
Actualización:
Code is
==========
if (flUpload.HasFile)
{
flUploaded.SaveAs("~//UploadedFiles//"+flUpload.FileName)
}
Uploaded folder is in my web root folder so theri is persmission.
Copyright © 2024 Q2A.ES - All rights reserved.
Answers & Comments
Verified answer
Do you have permission to upload to your local directory? Can you post your code? Here's what I've used in the past:
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
FileUpload1.SaveAs(@"C:\Inetpub\wwwroot\Intranet\Documents\" + FileUpload1.FileName);
Label1.Text = "File Uploaded: " + FileUpload1.FileName;
}
else
{
Label1.Text = "No File Uploaded.";
}
}
UPDATE:
Have you tried debugging? Have you added the asp.net user to the folder (ComputerName/ASPNET)?