Click here to Skip to main content
16,009,156 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralError msg: Failed to map the path '/' in file upload Pin
Member 387988123-Apr-08 23:07
Member 387988123-Apr-08 23:07 
Hi guys i installed my vs2005 in c drive
and i have my project in d drive
in that project i am doing fileupload concept
i given server mappath to save file:
fileupload1.PostedFile.SaveAs(Server.MapPath("\") & "OnLineResumes\" & filename)
now my quest is
the uploaded file will go and store in c drive or d drive inside the project...,
Means, in which drive it will consider as server mappath?
And see this is my code and its not at all storing the upload file in any of the drive...

I am getting error message as Failed to map the path '/'

See this is my code in button click event:


Dim sqlquery As String = "-"
Dim docid As Integer
sqlquery = "select isnull(max(ResumeId),1000)+1 from tblonlineresume"
sqlcmd = New SqlCommand(sqlquery, sqlconn)
sqlcmd.Connection.Open()
If sqlcmd.ExecuteScalar() > 0 Then
docid = sqlcmd.ExecuteScalar
End If
sqlcmd.Connection.Close()
sqlcmd.Dispose()


Dim filename As String = docid & System.IO.Path.GetFileName(fileupload1.PostedFile.FileName)

strdate = txtdob.Text
If Mid(strdate, 2, 1) = "/" Then strdate = "0" & strdate
If Mid(strdate, 5, 1) = "/" Then strdate = Left(strdate, 3) & "0" & Mid(strdate, 4, 6)
txtdob.Text = Mid(strdate, 4, 3) & Mid(strdate, 1, 2) & Mid(strdate, 6, 5)

Try
sqlcmd = New SqlCommand("submitOnlineResume'" & ddlJob.SelectedValue & "','" & txtName.Text & _
"',' " & txtemail.Text & "','" & txtQualify.Text & "','" & ddlYpass.SelectedValue & "','" & _
Mid(txtdob.Text, 4, 3) & Mid(txtdob.Text, 1, 3) & Mid(txtdob.Text, 7, 4) & "','" & _
ddlfarea.SelectedValue & "','" & ddlAspec.SelectedValue & "','" & txtsset.Text & _
"','" & filename & "'", sqlconn)
sqlcmd.Connection.Open()

sqlcmd.ExecuteScalar()
fileupload1.PostedFile.SaveAs(Server.MapPath("\") & "OnLineResumes\" & filename)

lblMessage.Text = "The file has been uploaded."
sqlcmd.Connection.Close()
sqlcmd.Dispose()

Catch ex As Exception
lblMessage.Text = ex.Message
Finally
End Try

sqlcmd.Connection.Close()
sqlcmd.Dispose()

Thanks & Regards,
NeW OnE,
please don't forget to vote on the post

GeneralRe: Error msg: Failed to map the path '/' in file upload Pin
samMaster23-Apr-08 23:19
samMaster23-Apr-08 23:19 
GeneralRe: Error msg: Failed to map the path '/' in file upload Pin
Member 387988123-Apr-08 23:26
Member 387988123-Apr-08 23:26 
Questionhow to find path of msi which is in Setup Pin
Piyush Vardhan Singh23-Apr-08 22:42
Piyush Vardhan Singh23-Apr-08 22:42 
AnswerRe: how to find path of msi which is in Setup Pin
eyeseetee23-Apr-08 22:53
eyeseetee23-Apr-08 22:53 
GeneralRe: how to find path of msi which is in Setup Pin
Piyush Vardhan Singh23-Apr-08 23:05
Piyush Vardhan Singh23-Apr-08 23:05 
GeneralIndexing search.... Pin
Moghan23-Apr-08 22:33
Moghan23-Apr-08 22:33 
GeneralRe: Indexing search.... Pin
eyeseetee23-Apr-08 22:52
eyeseetee23-Apr-08 22:52 
GeneralRe: Indexing search.... Pin
Moghan23-Apr-08 23:11
Moghan23-Apr-08 23:11 
GeneralRe: Indexing search.... Pin
Harini N K23-Apr-08 22:54
Harini N K23-Apr-08 22:54 
GeneralRe: Indexing search.... Pin
Moghan23-Apr-08 23:08
Moghan23-Apr-08 23:08 
GeneralRe: Indexing search.... Pin
Harini N K23-Apr-08 23:14
Harini N K23-Apr-08 23:14 
GeneralRe: Indexing search.... Pin
Harini N K23-Apr-08 23:19
Harini N K23-Apr-08 23:19 
GeneralRe: Indexing search.... Pin
Moghan23-Apr-08 23:39
Moghan23-Apr-08 23:39 
Generalsize of page Pin
ptvce23-Apr-08 22:03
ptvce23-Apr-08 22:03 
GeneralRe: size of page Pin
eyeseetee23-Apr-08 22:30
eyeseetee23-Apr-08 22:30 
GeneralRe: size of page Pin
ptvce23-Apr-08 23:48
ptvce23-Apr-08 23:48 
GeneralRe: size of page Pin
eyeseetee23-Apr-08 23:52
eyeseetee23-Apr-08 23:52 
GeneralRe: size of page Pin
ptvce23-Apr-08 23:59
ptvce23-Apr-08 23:59 
GeneralRe: size of page Pin
samMaster23-Apr-08 22:38
samMaster23-Apr-08 22:38 
Generallist box control Pin
rajkumar.323-Apr-08 21:43
rajkumar.323-Apr-08 21:43 
GeneralRe: list box control Pin
eyeseetee23-Apr-08 21:50
eyeseetee23-Apr-08 21:50 
GeneralRe: list box control Pin
rajkumar.323-Apr-08 22:05
rajkumar.323-Apr-08 22:05 
GeneralRe: list box control Pin
eyeseetee23-Apr-08 22:27
eyeseetee23-Apr-08 22:27 
Generalrich text format Pin
krishnaveer23-Apr-08 20:57
krishnaveer23-Apr-08 20:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.