What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Help, file upload

PHP Help, file upload
Author: Message:
megamuff
Full Member
***


Posts: 128
Reputation: -12
36 / – / –
Joined: Apr 2003
RE: PHP Help, file upload
quote:
Originally posted by Segosa
Can I just add a question while we're on the subject of uploading:

The mime-type is sent by the browser in the headers before the file is sent, or is it stored inside the file somehow? The reason I ask this is that if it's sent by the browser it is possible to fake it, and so upload a .php file pretending to be image/png or something else because only the mime-types are checked...

in order to upload the .php file as an image as you are describing, a setting in apache would need to be changed in the mime.types file.


quote:
Originally posted by WDZ
I'd probably do something like this...
code:
$types = array("image/gif", "image/pjpeg", "image/bmp", "video/mpeg", "video/x-msvideo", "image/png", "application/x-shockwave-flash");
if(in_array($HTTP_POST_FILES['file']['type'], $types)) {
:p

thanks. :P
02-02-2005 06:41 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP Help, file upload - by matty on 01-30-2005 at 10:14 PM
RE: PHP Help, file upload - by KeyStorm on 01-30-2005 at 10:22 PM
RE: PHP Help, file upload - by L. Coyote on 01-30-2005 at 10:58 PM
RE: PHP Help, file upload - by segosa on 01-31-2005 at 06:28 AM
RE: PHP Help, file upload - by megamuff on 02-01-2005 at 04:02 PM
RE: PHP Help, file upload - by segosa on 02-01-2005 at 09:44 PM
RE: PHP Help, file upload - by megamuff on 02-02-2005 at 03:03 AM
RE: PHP Help, file upload - by WDZ on 02-02-2005 at 03:55 AM
RE: PHP Help, file upload - by L. Coyote on 02-02-2005 at 04:06 AM
RE: PHP Help, file upload - by WDZ on 02-02-2005 at 04:09 AM
RE: PHP Help, file upload - by segosa on 02-02-2005 at 06:30 AM
RE: PHP Help, file upload - by megamuff on 02-02-2005 at 06:41 AM
RE: PHP Help, file upload - by WDZ on 02-02-2005 at 07:05 AM
RE: PHP Help, file upload - by KeyStorm on 02-02-2005 at 11:14 AM
RE: RE: PHP Help, file upload - by segosa on 02-02-2005 at 03:39 PM
RE: PHP Help, file upload - by WDZ on 02-02-2005 at 04:02 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On