FreeASPUpload

S

Simon

I'm sure you are all familiar with this free uploadscript, if not i'm happy
to post the sourcecode.
I use this to upload files to the server, but it doens't check wether the
file already exists or not.
Anyone knows how to add this into the script?
It's also possible to do it onformsubmit and return false if the file
already exists, but what is the scriptcode?

Thanks,
Simon
 
E

Erwin Moller

Simon said:
I'm sure you are all familiar with this free uploadscript, if not i'm happy
to post the sourcecode.
I use this to upload files to the server, but it doens't check wether the
file already exists or not.
Anyone knows how to add this into the script?
It's also possible to do it onformsubmit and return false if the file
already exists, but what is the scriptcode?

Thanks,
Simon

Simon,

What uploadscript?
And what has JavaScript to do with fileuploads in ASP?
Why not ask in an VB/ASP group?

Regards,
Erwin Moller
 
S

Simon

Didn't think of that, I'll rephrase my question:
How can javascript detect if a filename exists on the server?
(In scriptcode ;) )

"Erwin Moller"
 
E

Erwin Moller

Simon said:
Didn't think of that, I'll rephrase my question:
How can javascript detect if a filename exists on the server?
(In scriptcode ;) )

Hi Simon,

Javascript is intentionally crippled when it comes to fileupload
functionality.
This is a securitymeasure to avoid malicious sites tamper with the
fileupload and add files you don't want to upload to the fileupload.

So, checking if the filename exists on the server is no big deal (you
can do this with AJAX, and a simple script on the server.), but finding
out the names of the files is blocked.

Regards,
Erwin Moller
 
T

Tim Slattery

Simon said:
Didn't think of that, I'll rephrase my question:
How can javascript detect if a filename exists on the server?
(In scriptcode ;) )

It can't. There's no way that a script running on the client can tell
what files exist on the server. The program running on the server
(presumably ASP, from your question) can look at the server's disks
and tell what's there. Of course, that can't happen until the file is
uploaded.

I suppose the server-side process that generates the file upload page
could get a list of existing files and embed that in the page somehow
(may in a Javascript, maybe in something that the Javascript could
access). Or maybe that's more information than you want your user to
know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,408
Latest member
AlenaRay88

Latest Threads

Top