If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > File System Object Problem Path Not Found

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-28-06, 10:51
KlansMan KlansMan is offline
Registered User
 
Join Date: Apr 2004
Posts: 50
File System Object Problem Path Not Found

Hi there i hope some one can shed some light on problem .

I have writen some code which copys all the file in a selected folder to a destination folder if the file does not already exist in the destination folder
The code work 100% fine on my laptop in the inetpub\wwwroot folders but when i've put the pages on the web server i just keep getting the error path not found


I have put a * box around where am getting the error

please see code below

My form where you select a file from the folder you want to upload from

<form action="Add_Report_Submit.asp" enctype="multipart/form-data" method="get">
<input name="txtPath" type="file" id="txtPath" size="80" />
<br>
<input type="submit" name="Submit" value="Submit" />

</form>


The Code Below is the code which copys the files
************************************
* Add_Report_Submit.asp *
************************************
<%
' Set file system object
Set fso = Server.CreateObject("Scripting.FileSystemObject")

'Create recordset Object
Set newrec = server.CreateObject("ADODB.Recordset")

newrec.open "tbl_SAS_Documents", objConn,2,3

' Path to upload the files to
uploadFolder = "c:\Inetpub\wwwroot\Transactional_Services\Subsite s\SAS_Reports\Documents\"

' Set path with file attached
Path = Request.QueryString("txtPath")

' obtain folder that the file is held in
objFolder = fso.GetParentFolderName(Path)

' Add \ To the path way of folder where files are held
objFolder = objFolder & "\"
***************************************
' object holding the folder where files are *
set fs=fso.GetFolder(objFolder) *
***************************************
' Uploaded Array size
intUpLoad = 1

' Not Uploaded Array Size
IntNotUpLoad = 1

' for each file in the folder object do the following
For Each x In fs.Files


'Get File From Folder To Upload From
set f=fso.GetFile(objFolder & x.name)

' Check To See If File Does Not Exist In The Folder To Upload To Do
If fso.FileExists (uploadFolder & x.name) = false Then

' Change Upload Array Size keeping any information held in there
ReDim Preserve Upload(intUpLoad)

' Add File Name To Array
Upload (intUpLoad-1) = x.name

' Add File Info To Database

' Copy File To Upload folder
f.Copy uploadFolder & x.name , false

' Add 1 To Array size
intUpLoad = intUpLoad +1

' If the Files Exists
ElseIf fso.FileExists (uploadFolder & x.name) = true Then

'Change the File Not Uploaded array size
ReDim Preserve notUpload(IntNotUpLoad)

' Add The Not Uploaded File Name To Not uploaded array
notUpload (IntNotUpLoad-1) = x.name

' Add 1 Onto the not uploaded array size
IntNotUpLoad = IntNotUpLoad +1
End IF

' Move onto the next file in the folder object
Next
%>


I hope some one can give some ideas on how to solve this problem or knows how to solve this problem

Cheers for any help in advance
Reply With Quote
  #2 (permalink)  
Old 04-05-06, 11:04
thele thele is offline
Registered User
 
Join Date: Jun 2003
Location: Ohio
Posts: 108
Thumbs up

Sounds like it could be a permission issue. Check your IUser account, to make sure it has access to all those directories.

~Le
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On