472,789 Members | 1,156 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 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 1890
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
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.