|
-
Jan 2nd, 2001, 02:42 AM
#1
Thread Starter
Hyperactive Member
Hi,
I need to upload images(jpegs and gifs) to the server. This I've managed. But what I haven't been able to do is check whether the file being uploaded is a valid one or not. For example, if I open notepad and then save the file with a .jpg extension, and then try to upload it, it gets uploaded. which should not happpen. Any ideas on how I can prevent this???
Thanx.
-
Jan 2nd, 2001, 03:18 AM
#2
Lively Member
maybe it depends on what COM you are using to
upload the files.
in SA-FileUP (tm?),
you can query on the MIME type like this:
var upl = Server.CreateObject("SoftArtisans.FileUp")
if (upl.Form("FILENAME").ContentType=="application/msword")
or "text/html" or "image/jpes"...
itay.
-
Jan 2nd, 2001, 03:55 AM
#3
Thread Starter
Hyperactive Member
??? could u elaborate on that....
-
Jan 2nd, 2001, 03:59 AM
#4
Lively Member
could you elaborate your question?
what i was explaining,
is how to detect file type (MIME) of uploaded file
(using html FORM and INPUT TYPE=FILE)
via SA-filpup componenent, in jscript ASP.
itay.
-
Jan 2nd, 2001, 04:04 AM
#5
Thread Starter
Hyperactive Member
Ive used the code from http://www.planetsourcecode.com to carry out the upload process. I need to be able to validate the file being uploaded (whether its a valid image file or not).
-
Jan 3rd, 2001, 01:44 AM
#6
Thread Starter
Hyperactive Member
-
Jan 5th, 2001, 02:24 AM
#7
Thread Starter
Hyperactive Member
yet another post to bring this thread to the top........
[Edited by rammy on 01-08-2001 at 01:59 AM]
-
Jan 8th, 2001, 02:02 AM
#8
Thread Starter
Hyperactive Member
im starting to talk to myself here....
-
Jan 12th, 2001, 06:20 PM
#9
Addicted Member
Hi there rammy,
The planetsourcecode.com code is extremely complex don't you think? Since you have successfully completed the upload process with that code, can you please explain what is actually done in the code?
Thanks in advance
-
Jan 12th, 2001, 07:14 PM
#10
Junior Member
You can write a VB program that will download the image. If an error occurs when displaying the image, you know that the file is not an image.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|