Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP.NET (http://www.go4expert.com/forums/asp-net/)
-   -   URGENT: file upload control Asp.Net (http://www.go4expert.com/forums/urgent-file-upload-control-aspnet-t24119/)

AspStudent 8Dec2010 13:24

URGENT: file upload control Asp.Net
 
Hi all,
I have a problem and I really need your help ASAP

I am using Asp.Net and I created the fileUpload control inside an Ajax control in order to view it in ModalPopupExtender

I have several file upload in one page, so I want the user to upload all the files and then click the save button on the page to save all information.

here is the process that I want to apply:
1. The user clicks on an upload button on the page
2. The Ajax popup extender that contains the FileUpload control appears
3. The user browses and chooses the file
4. Click submit in order to go back to the main page
5. The same process is applied on other upload buttons
6. At the end of the process, the user clicks on the save button on the main page
7. the files are saved in a folder


The following method is the method when the user clicks on the submit button in the Ajax popup extender after browsing and choosing the file:

IfNot IpFile.PostedFile.FileName = ""Then
Dim intFileNameLength AsInteger
Dim strFileNamePath AsString
'Logic to find the FileName (excluding the path)
strFileNamePath = IpFile.PostedFile.FileName
intFileNameLength = InStr(1, StrReverse(strFileNamePath),
"\")
Session(
"strFileAnimalEngNameOnly") = DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + Mid(strFileNamePath, (Len(strFileNamePath) - intFileNameLength) + 2)
EndIf

This is the line of code whithin the save button method that is supose to save the file in the database:

IpFile.PostedFile.SaveAs(Server.MapPath("~\uploads\" + Session("strFileAnimalEngNameOnly")))


when the line of saving is whithin the submit method the file is saved but not when I want it to be saved
but when i out it in the main page save button it doesn't :confused:


pleaaase help.. its urgent.. i have a project and i really need this logic to work :undecided

thanks alot

please help



All times are GMT +5.5. The time now is 03:32.