Cant not upload file to destination location

J

John

Dear,

We have 2 IIS server on win2000. we use the web server for upload file from
server1 IIS to server2 IIS. We can connect from IIS1 to IIS2 success but the
file unable to upload with below message. Would u help?

If FileUpload_TXT.PostedFile.ContentLength = 0 Then
Panel_FileInfo.Visible = False
Exit Sub
Else
Panel_FileInfo.Visible = True

str_UploadFilePath = GetUploadPath()

FileName_LAB.Text = FileUpload_TXT.PostedFile.FileName
FileSize_LAB.Text = CStr(FileUpload_TXT.PostedFile.ContentLength)
FileType_LAB.Text = FileUpload_TXT.PostedFile.ContentType

Dim str_Filename As String = GetUploadPath()

Dim FileSplit() As String =
Split(FileUpload_TXT.PostedFile.FileName, "\")
Dim FileName As String = FileSplit(FileSplit.Length - 1)

str_FilePathName = str_UploadFilePath + FileName

Dim str_xmlSpName As String
str_xmlSpName = Request.QueryString("str_SpName")

Response.Write("BEFORE - " & str_FilePathName & "<BR>" & "<BR>")

Response.Write("<a href=" & str_FilePathName & ">Name</a>)<BR>")
Response.Write("<a href=" & str_UploadFilePath & ">Path</a>)<BR>")

FileUpload_TXT.PostedFile.SaveAs(str_FilePathName)
<--------------------- Cant not upload file to destination location .

Response.Write("END ---- " & str_FilePathName & "<BR>")

If File.Exists(str_FilePathName) Then
If Request.QueryString("str_BtnKey") = "XLS" Then
Read_XLS(str_xmlSpName)
Message_LAB.Text = "æˆ åŠŸ 上 載 檔 案 。"
Else
'-- Read Xml data
Read_XML(str_xmlSpName, str_FilePathName)
End If
Else
Panel_FileInfo.Visible = False
Message_LAB.Text = "上 載 檔 案 失 敗, è«‹ é‡ å¾© 嘗 試。"
End If
End If


ManyThanks
 
P

Patrice

You forgot to include the error message. What is str_FilePathName ? For now
my guess is that you try saving the file using http. SaveAs will only save
on a filesystem (local driver, network share etc...).
Else it could be a permission issue (remember that the Web server may run
under another identity than the one with which you have tried the
connection).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top