Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 4th, 2003, 09:38 AM
Registered User
 
Join Date: Jul 2003
Location: Knoxville, TN, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need Help with FSO.GetFile

I'm trying to verify that a file exists in a virtual directory by using objFSO and the GetFile method. I have verified the file exists in the directory but for some reason I keep getting a VB Script "File Not Found" error. Code is as follows:


Dim objFSO, objFile

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.GetFile(Server.MapPath("VirtualDirectory\" & FileID & ".jpg"))

Any help on this would be greatly appreciated.

Paul Noe
paul@thenoes.com
 
Old December 5th, 2003, 03:32 AM
Authorized User
 
Join Date: Jul 2003
Location: Athens, , Greece.
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try the following:

Dim objFSO, objFile

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

If objFSO.FileExists(Server.MapPath("VirtualDirectory \" & FileID & ".jpg")) Then
Set objFile = objFSO.GetFile(Server.MapPath("VirtualDirectory\" & FileID & ".jpg"))

Else
Response.Write "The given Path is: " & Server.MapPath("VirtualDirectory\" & FileID & ".jpg")
End If

This should get the file if it does exist or it will show you whats wrong with your path :) (..probably thats the problem)

Kostas Lagos

 
Old December 5th, 2003, 09:32 AM
Registered User
 
Join Date: Jul 2003
Location: Knoxville, TN, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Kostas! I'll give that a shot.

Paul Noe
paul@thenoes.com
 
Old December 10th, 2004, 03:51 AM
Registered User
 
Join Date: Dec 2004
Location: , , India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Saravanan_S
Default

Hi

I wanted a code which can look the movement of a file. For example,

If a particular XML files moves from Inbox into Processed folder. I wanted to do coding to verify this and also added up this code into QTP Testing Tool.

Help me out guys

Saravanan
 
Old December 20th, 2006, 06:03 AM
Registered User
 
Join Date: Jun 2006
Location: THANE, MAHARASHTRA, India.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
i can try so much but it cant happen....
i can used this getfile in delete method..






Similar Threads
Thread Thread Starter Forum Replies Last Post
FSO issue logidude Classic ASP Basics 5 April 24th, 2007 10:20 AM
FSO help (ASAP) software_developer_kk Classic ASP Basics 1 April 7th, 2005 08:18 AM
FSO - unstable nancy Classic ASP Databases 3 September 10th, 2004 09:52 AM
FSO mikedeepak Classic ASP Databases 5 August 4th, 2004 05:55 AM
FSO mikedeepak Classic ASP Databases 0 August 4th, 2004 12:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.