473,386 Members | 1,830 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,386 software developers and data experts.

File check in ASP

hi
I'm writing, or trying to! an ASP page that checks if a file exists and if
so transfers it. the use sends a query string with the name of the file, I
have this bit working, but need to check if the path and or file exists in
vb6 I would write

if dir(strFileName & "\test.zip")) <>"" then
msgbox("OK 1 ")
else
msgbox("OK 2 ")
end if
In VBS for ASP?
if dir(Server.MapPath(strFileName & "\test.zip")) <>"" then
response.write ("OK 1 ")
else
response.write ("OK 2 ")
end if
Jan 5 '06 #1
2 2418
in ASP/VBScript to check if a file exists use code like this
(change your file path accordingly.. this is an example from one of my
projects)

Dim fsoObject
Set fsoObject = CreateObject("Scripting.FileSystemObject")
If fsoObject.FileExists(UploadDirectory & "\Cat1_" & Request("Cat1_ID") &
".jpg") Then
' do whatever
End If
Set fsoObject = Nothing
"Adrian" <Ad****@nospamhotmail.com.uk> wrote in message
news:dp**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
hi
I'm writing, or trying to! an ASP page that checks if a file exists and if
so transfers it. the use sends a query string with the name of the file,
I have this bit working, but need to check if the path and or file exists
in vb6 I would write

if dir(strFileName & "\test.zip")) <>"" then
msgbox("OK 1 ")
else
msgbox("OK 2 ")
end if
In VBS for ASP?
if dir(Server.MapPath(strFileName & "\test.zip")) <>"" then
response.write ("OK 1 ")
else
response.write ("OK 2 ")
end if

Jan 5 '06 #2
many thanks

"Kyle Peterson" <ky*****@hotmail.com> wrote in message
news:uY*************@tk2msftngp13.phx.gbl...
in ASP/VBScript to check if a file exists use code like this
(change your file path accordingly.. this is an example from one of my
projects)

Dim fsoObject
Set fsoObject = CreateObject("Scripting.FileSystemObject")
If fsoObject.FileExists(UploadDirectory & "\Cat1_" & Request("Cat1_ID") &
".jpg") Then
' do whatever
End If
Set fsoObject = Nothing
"Adrian" <Ad****@nospamhotmail.com.uk> wrote in message
news:dp**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
hi
I'm writing, or trying to! an ASP page that checks if a file exists and
if so transfers it. the use sends a query string with the name of the
file, I have this bit working, but need to check if the path and or file
exists in vb6 I would write

if dir(strFileName & "\test.zip")) <>"" then
msgbox("OK 1 ")
else
msgbox("OK 2 ")
end if
In VBS for ASP?
if dir(Server.MapPath(strFileName & "\test.zip")) <>""
then
response.write ("OK 1 ")
else
response.write ("OK 2 ")
end if


Jan 6 '06 #3

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

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
3
by: Don Pasquale | last post by:
The following function intends to delete "numberoflines" lines from a text file, named "s" (string pointer) and pointed to by file pointer "fp", starting from line "line". Now, the function...
2
by: mhadi | last post by:
Hello Please Help me!! The big bossman is screaming in my ear, I am only devloper of dotnet in my software house and know only to develop widows based application !! My boss wan't me to...
4
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command...
1
by: John Wright | last post by:
During my program I load an exe file using reflection. My program loads the file using reflection, checks the assembly version and does an update if the network version is different from the local...
6
by: magix | last post by:
Hi, when I read entries in file i.e text file, how can I determine the first line and the last line ? I know the first line of entry can be filtered using counter, but how about the last line...
3
by: sam_cit | last post by:
Hi Everyone, I have a buffer having some raw ASCII data and i want to write it into a file. One way is to loop through the buffer and write a single character at a time and close the file after...
24
by: Bill | last post by:
Hello, I'm trying to output buffer content to a file. I either get an access violation error, or crazy looking output in the file depending on which method I use to write the file. Can anyone...
1
by: shyaminf | last post by:
hi everybody! iam facing a problem with the transfer of file using servlet programming. i have a code for uploading a file. but i'm unable to execute it using tomcat5.5 server. kindly help me how to...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.