473,382 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Cant not upload file to destination location

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
May 3 '06 #1
1 1525
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).

--
Patrice

"John" <Jo**@discussions.microsoft.com> a crit dans le message de news:
9D**********************************@microsoft.com...
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

May 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: matt | last post by:
I have this code, works perfectly on Windows server, but now i'm trying to run it on a Linux server, the form submits, i get no errors, but the photo doesnt upload, and the caption file doesnt...
3
acoder
by: acoder | last post by:
How to Upload a File in Coldfusion Use the cffile tag for uploading files to the server. Note that allowing people to upload files is fraught with danger and only trusted users should be...
0
by: santybanty20 | last post by:
sir,i have written the code for file uploading but it is very slow like it takas 2 to 3 minutes for 5 kb file and for 1 mb abt 20 minutes.so here is my code please help me for fast uploading also the...
2
by: Event Horizon | last post by:
Hi, I'm trying to add an simple upload applet to shopping cart script. My new applet form sends all needed post fields ( quantity, product, etc... ) but the "file" post field is hardcoded in...
4
by: Tony B | last post by:
I've moved an existing site (which I didn't write) from a apache/php/mysql host under windows to a linux apache/php/mysql host. I've sorted out most problems except one. There is an upload...
2
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but...
2
by: hotflash | last post by:
Hi Master CroCrew, I found a good PURE ASP that will allow you to upload 10MB file to the server and the file contents such as Network, Author, Title, etc... will insert to MS Access at the same...
43
by: bonneylake | last post by:
Hey Everyone, Well this is my first time asking a question on here so please forgive me if i post my question in the wrong section. What i am trying to do is upload multiple files like gmail...
4
by: MoroccoIT | last post by:
Greetings - I saw somewhat similar code (pls see link below) that does mupltiple files upload. It works fine, but I wanted to populate the database with the same files that are uploaded to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.