Results 1 to 10 of 10

Thread: uploading images...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    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.

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    102
    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    ??? could u elaborate on that....

  4. #4
    Lively Member
    Join Date
    Jan 2000
    Posts
    102
    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.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    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).


  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Question

    any ideas??

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    yet another post to bring this thread to the top........

    [Edited by rammy on 01-08-2001 at 01:59 AM]

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Red face

    im starting to talk to myself here....

  9. #9
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    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

  10. #10
    Junior Member
    Join Date
    Dec 2000
    Posts
    16
    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
  •  



Click Here to Expand Forum to Full Width