hi,
i am having a problem when using the fileupload control to update my data base with the file that the user selected with the fileupload control.
after the user selectd the file i want it to bind the link to the database and it seem working ok with the binding but it take alot of time for the page to refresh the page with the new link.it look like it copying somthing or doing somthing that make the HD work and the page load very slowly after i press the "Update" button.
the only thing i need from the controller is the path for the file and not the file it self.
my code is:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName=="Update")
{
FileUpload myFileUpload = (FileUpload)GridView1.Rows[GridView1.EditIndex].FindControl("FileUpload1");
TextBox myTextBox = (TextBox)GridView1.Rows[GridView1.EditIndex].FindControl("Network_File_LinkTextBox");string myFileName = myFileUpload.PostedFile.FileName.ToString();if (myFileUpload.PostedFile.FileName != "")
{ myTextBox.Text = myFileName; }
}
}
i have one text box that bind regular text ,and next to it the file upload that pass the user select file to that text box and then the binding is excuted with the new value from the fileupload controll.
i didnt notice the problem with the binding time first because i was chooosing smal file like word file and text file.
when tried bigger files i got error.so i added this to the config file:
<
httpRuntime executionTimeout="90" maxRequestLength="2097151" useFullyQualifiedRedirectUrl="false" requestLengthDiskThreshold="8192"/>
but when i tried to pick an big avi file (700MB) (i only need the path and name of the file) and press the update button i saw that it take time for the page to refressh with the new details.
its working but it take allot of time for only i need the path and name.
can some help to understand why it take so mucj time.
or mabe there is better way to bing the file and path to the sql DB.
thanks in advance.