Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

PHP image upload

Name: Anonymous 2007-06-06 8:03 ID:bGRbOOvu

So I'm trying out this: http://lv.php.net/manual/en/features.file-upload.php

Almost as it is, just changed the upload dir to correct one and gave it 777 in chmod.

I have two files, one contains that html form the other one php code.

But instead of correct file upload I get this:
Possible file upload attack!
Here is some more debugging info:Array
(
    [userfile] => Array
        (
            [name] => 4chan.jpg
            [type] =>
            [tmp_name] =>
            [error] => 2
            [size] => 0
        )

)

Name: Anonymous 2007-06-06 8:47 ID:bGRbOOvu

Any help? I'm looking at that code and can't figure out the shit...

Name: Anonymous 2007-06-06 8:51 ID:Heaven

use perl

Name: Anonymous 2007-06-06 8:53 ID:J8AF2/P3

>>1
Don't give chmod 777. Use chmod 600, and give ownership to the user under which the web server is ran.

Before echoing/placing the <INPUT TYPE="FILE"...> in your web page, be sure to add
<INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="XXX">
where XXX is the maximum allowable upload file size in bytes.

Name: Anonymous 2007-06-06 9:05 ID:bGRbOOvu

>>4
Damn, how much I hate this stuff in programming, to get to the point - max file size was too small and that's it! Geez...

Thanks for the tip on chmod, Anon!

Name: Anonymous 2007-06-06 9:13 ID:Fq/0g9WS

>>4
Why would you put the maximum file size on the client side? You can easily change that.

Name: Anonymous 2007-06-06 9:22 ID:J8AF2/P3

>>5
Damn, how much I hate this stuff in programming
It's all about it

>>6
It's useless but required. You also have a server-side configuration variable to control the actual limit.

Name: Anonymous 2007-06-06 13:51 ID:Heaven

>>7
It's useless
Perfect description of PHP

Name: Anonymous 2007-06-06 14:30 ID:NPjHjSQQ

>>4

You want to set the execute bit on directories.

Name: Anonymous 2007-06-06 17:15 ID:Heaven

>>4
even better would be to set it 770 and have the user set to you and the group set to the group www and have both yourself and the web server user (probably also called www) in the www group.

Name: Anonymous 2007-06-06 19:54 ID:2IJjTs9u

>>9
True, I brainfarted.

Name: Anonymous 2009-01-14 13:45

FGGFDS

Name: Anonymous 2009-03-06 9:41

The fucking scrollbar but   setting the size   of my code   is mov ax   num1 cmp ax   num2 jbe skip   mov ax num2   jbe skip mov   ax num2 skip.

Name: Anonymous 2010-12-25 20:33

Name: Anonymous 2011-02-03 7:42

Name: Anonymous 2011-02-04 18:29


Don't change these.
Name: Email:
Entire Thread Thread List