Forum Moderators: open

Message Too Old, No Replies

form input type=file not working right

         

ofjurai

5:18 am on May 29, 2004 (gmt 0)

10+ Year Member



I've been trying to add a form to my site where someone could fill it out and submit an image.

When I use an input like

<input type=file name="potw" accept="image/jpeg" size="45">

I do not get the image sent to me - I just reveive the path to the image that they wanted to submit.

I'm new to forms so I don't even know where to begin trying to fix it.

I'm using a free cgi that came with my webhosting called FormMail. I figured that maybe the cgi just accepted text?

If someone could help me fix this cgi or make a new one or whatever.. any help would be greatly appreciated.

Also, how would I add more file types to the accept=?
accept="image/jpeg,gif"?

zollerwagner

8:01 am on May 29, 2004 (gmt 0)

10+ Year Member



Let me preface this by saying I've never used a form to submit an image.

One comment, though is that you may need quotes around "file".

To add a second type to the list, I think you'll need to write the complete phrase, like this:

<input type="file" accept="image/jpg, image/gif" ....

I wonder, though, whether form mail can handle images. You'll probably have to check the specs to find that info.

Good luck!

BlobFisk

10:42 am on May 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




This attribute specifies a comma-separated list of content types that a server processing this form will handle correctly.

From: [w3.org...]

Zollerwagner hit the nail on the head. The content type list [w3.org] for images can be found here:

  • ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/image/

    HTH

  • dcrombie

    11:16 am on May 29, 2004 (gmt 0)



    Current browsers generally ignore the ACCEPT attribute [htmlhelp.com].

    What's probably missing is the enctype attribute of the FORM:

    [w3.org...]

    ;)