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

How to check a file at client side

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 devolope a page so that when a user clicks a link to to
download a file the page check directory at client side(fixed lets name it
"c:\download") and search for file say "blablav1.1.exe" (version will be
updated)

if file is found then
dont download it
else if it is not then
download the new version and execute it to install

waiting for quick rescue
mhadi
Nov 18 '05 #1
2 1918
It's no problem to check the client side file system if your clients will be
IE, you can use the VBScript "FileSystemObject" to check if the file is
there or not.

The problem is using the client to cancel the download that has already
begun at the server level.

You might want to try having the link point, not to the file for download,
but to a page that consists of nothing but the code that will check to see
if the user already has the file. If they do, the page can redirect them
back to where they came from without doing anything and if they don't, the
file can redirect them to a page that sends the file down to them.

Check here for info. on using the FSO (also look at the methods link for the
"FileExists" method that you will need):

http://msdn.microsoft.com/library/de...stemobject.asp
"mhadi" <mh*****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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 devolope a page so that when a user clicks a link to to download a file the page check directory at client side(fixed lets name it
"c:\download") and search for file say "blablav1.1.exe" (version will be
updated)

if file is found then
dont download it
else if it is not then
download the new version and execute it to install

waiting for quick rescue
mhadi

Nov 18 '05 #2
Here's an old example I dug up...

<HTML>
<HEAD>
<title>Using the FileSystem Object</title>
</HEAD>

<BODY>
<SCRIPT LANGUAGE="VBScript">
Dim fso, myFile

Set fso = CreateObject("Scripting.FileSystemObject")

if fso.FileExists("c:\VBScript.txt") then
'The number 8 represents the 'ForAppending' constant
'The 'True' argument says to create the file if it doesn't exsist
'but in this example, it doesn't matter because we are inside of the
'true condition that tests if the file exists anyway
set myFile = fso.OpenTextFile("c:\VBScript.txt",8, True)
myFile.WriteLine(inputbox("What would you like in your text file?"))
myFile.WriteLine(date & " - " & navigator.appName)
myFile.Close
end if

'************************************************* **************************
*********

Dim Drive, AllDrives
Set fsObj = CreateObject("Scripting.FileSystemObject")
Set AllDrives = fso.Drives

For Each Drive in AllDrives

document.write (Drive.DriveLetter & " - ")

If Drive.DriveType = 3 Then 'Network Drive
document.write (Drive.ShareName)
ElseIf Drive.IsReady Then 'Removable Media with Media Present
document.write (Drive.VolumeName)
End If

document.write("<BR>")
Next

Set myFile = nothing
Set Drives = nothing
set fso = nothing
</SCRIPT>
</BODY>
</HTML>
Nov 18 '05 #3

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

Similar topics

2
by: vishal | last post by:
hi is there anyway that i can check the size of file on client side before uploading file to server???? suppose the user uploads file of 10 mb then the server will know the size is 10 mb...
3
by: Matt | last post by:
<input type="file" size=50"> will produce the browse button and browse text box. The user can either select the file from browse button, or enter a path in browse text box manually. My question...
21
by: ryanmhuc | last post by:
I know the subject might be confusing. I am no beginner with javascript but I haven't been able to figure out how to get the javascript file name from code inside the file. So you have an HTML...
1
by: Helixpoint | last post by:
I upload a file with the following code. Is there a way to check to see if the file is currently there before I upload? Dim s1 As String Dim s2 As String Dim pos As Integer s1 =...
9
by: PawelR | last post by:
Hello group, I'm begginer in ASP.net and my question is very simple. In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set myDDL.Enabled =myCB.Checked and show change without...
3
by: walterbyrd | last post by:
I am working on a timecard app. When somebody logs in, it stamps his/her time. Problem is, I have to make sure that somebody is not logging in from a remote site. I want all the logins from one...
5
by: thisis | last post by:
Hi All, Hi All, (this is not the same topic as the my previous topic) What objects/methods/properties does VBScript offer for: Assuring/guarantee/make certain that ASP/VBSCript an ELEMENT...
19
Frinavale
by: Frinavale | last post by:
Filtering user input is extremely important for web programming. If input is left unfiltered users can input malicious code that can cripple your website. This article will explain how to make...
7
by: Vishal | last post by:
Hi, I am writing a CGI to serve files to the caller. I was wondering if there is any way to tell in my CGI if the client browser is still connected. If it is not, i want to execute some special...
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: 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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.