Re: [PHP] File Upload Problem

2011-04-06 Thread Bastien Koert
On Wed, Apr 6, 2011 at 1:10 PM, tedd t...@sperling.com wrote:
 Hi gang:

 I wrote a simple script to upload image files from my desktop to a server --
 the exact same code works on two servers, but fails on a third.

 I suspect there is something set different between the servers, but I can't
 find it.

 Oddly enough, I can upload image files directly to the database, but not to
 the file system.

 What could be wrong? What should I be looking for?

 Cheers,

 tedd

 --
 ---
 http://sperling.com/

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



check out the max post size

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload Problem

2011-04-06 Thread Daniel Brown
On Wed, Apr 6, 2011 at 13:10, tedd t...@sperling.com wrote:
 Hi gang:

 I wrote a simple script to upload image files from my desktop to a server --
 the exact same code works on two servers, but fails on a third.

 I suspect there is something set different between the servers, but I can't
 find it.

 Oddly enough, I can upload image files directly to the database, but not to
 the file system.

 What could be wrong? What should I be looking for?

Are file uploads enabled and is the size of the file less than the
upload size limitation?  Is the disk or partition to which the
temporary files are being uploaded out of space, whereas the database
- perhaps on a different physical disk or partition - still has
sufficient free space?  Are you sure the user as which the web server
(presumably Apache) runs has permission to write to the temporary and
target directory?  Is the account near or at its disk quota?

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload Problem

2004-12-20 Thread Richard Lynch
Wayne Donaho wrote:
 I am trying to run a file upload using PHP as a CGI script and am running
 into an odd error.

 The error I am getting is the dreaded Server Error -- Error 500 Premature
 end of script headers: php.cgi

Some more analysis ideas:

On the very first line of your script, print out something and call
http://php.net/flush and then exit;.  Or is that what your it ran
script does?

Just want to be sure you have the exit; in there to be SURE it's a
server configuration error, and not something actually in your script to
kill PHP/CGI/Apache-child.

Check httpd.conf settings -- Perhaps you specifically disallowed certain
kinds of HTTP requests there... I have no idea *how* you can do this, or
if you can do this, but I hypothesize that it's possible to be done, so
maybe you did it.

I know you can disallow GET and/or POST etc, but not sure you can
fine-tune it down to mime-type or not.  It's up to you to figure out if
this can be done, and if you've done it in httpd.conf or not.  Possibly
also in .htaccess, also.

See if you can trigger the problem with *other* valid types of ENCTYPE --
The one used in the ubiquitous PostToHost function comes to mind.  If
you can determine that it's more than just multipart/form-data, and also
include, say, 'application/x-www-form-urlencoded' then it may help
identify the source or the problem.

For fun, take out the suexec on your development server and prove, once
and for all, that it's not related to suexec.

Since you've already tried so many other things, compile PHP without *ANY*
of the extra stuff.  No payfloPRO.  No GD. No zlib. No jpeg. No xpm. No
curl. No nothin' but --with-cgi (or whatever it is).  Just to eliminate
other software from the picture of possible culprits.

Are you doing any of this through SSL?  You don't really say, but you've
got SSL in the ./configure...  Try it without SSL, of course, if you've
only tried with SSL so far.

Don't see how it could help, but error_reporting E_ALL is always a Good
Idea. :-)

 Here is the diagnosis I have done.

 1.  The php.cgi executable deals with scripts correctly when using the GET
 method.
 2.  The php.cgi script deals with POST method requests properly when the
  enctype is NOT multipart/form-data

 This rules out suexec type errors.  (in any case the suexec log shows
 everything is good).

 3.  File uploads using the mod_php work fine (this rules out apache not
 accepting the file)

 4. the CGI log shows the request being sent to the script, and that there
 is
 no result.

 5. The above error is not script dependent, the error occurs with a
 on-line
 script
 that prints the string it ran when the form enctype is
 multipart/form-data.

 6.  The upload script is being taken from a different box running
 different
 versions of apache/php
  and the script works correctly there.

 I have tried this with various version of php all with the same results.
 I
 have built it with php.4.3.10.

 Here are the configure options from the phpinfo report:
 './configure' '--enable-force-cgi-redirect' '--with-openssl' '--with-curl'
 '--with-mysql' '--with-cgi'
 '--with-pfpro=/home/wayne/verisign/payflowpro/linuxrh9' '--with-gd'
 '--with-jpeg-dir' '--with-zlib-dir' '--with-xpm-dir' '--with-freetype-dir'
 '--enable-ftp'

 I have the following file variables set:
 error_reporting 2039
 file_uploads On
 log_errors On
 max_input_time -1
 post_max_size 8M
 safe_mode off
 upload_max_filesize  2M
 upload_tmp_dir  /tmp


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP File Upload Problem

2004-11-12 Thread Mike Walsh

Mike Walsh [EMAIL PROTECTED] wrote in message news:0%ald.9258

[ ... snipped ... ]

 ; Maximum allowed size for uploaded files.
 upload_max_filesize = 1G


[ ... snipped ... ]

It turns out that 1G is not a valid value for this directive.  Not sure why
I haven't run into this problem previously but setting it to a megabyte
value solves my problem.

Mike

-- 
Mike Walsh - mike_walsh at mindspring.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload Problem

2004-10-20 Thread Robby Russell
On Wed, 2004-10-20 at 19:27 -0400, Nathan Mealey wrote:
 This file upload problem has me very confused.
 
 The code is:
 
 $upload_dir = '/articles_store/';
 $uploadfile = $upload_dir . basename($_FILES['userfile']['name']);
 
 if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) {
 } else { die (Cannot upload file);
 }
 
 (this code is practically verbatim the example from php.net)
 
 The directory '/articles_store' has permissions 777.  And the user is  
 and group are 'www' (the Apache user).

Are you sure that this is the correct path? Did you create a new path in
your root level as /articles_store ?

so, if I go on your machine and type in:
$ cd /
$ ls 

it'll show
/articles_store
/dev
/etc
/var

...etc?


-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] File Upload Problem

2004-10-20 Thread Robby Russell
On Wed, 2004-10-20 at 17:00 -0700, Robby Russell wrote:
 On Wed, 2004-10-20 at 19:27 -0400, Nathan Mealey wrote:
  This file upload problem has me very confused.
  
  The code is:
  
  $upload_dir = '/articles_store/';
  $uploadfile = $upload_dir . basename($_FILES['userfile']['name']);
  
  if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) {
  } else { die (Cannot upload file);
  }
  
  (this code is practically verbatim the example from php.net)
  
  The directory '/articles_store' has permissions 777.  And the user is  
  and group are 'www' (the Apache user).
 
 Are you sure that this is the correct path? Did you create a new path in
 your root level as /articles_store ?
 
 so, if I go on your machine and type in:
 $ cd /
 $ ls 
 
 it'll show
 /articles_store
 /dev
 /etc
 /var
 

Basically, my first guess is that you are not understanding the
directory structures properly. You need to give it the full path if
you're going to have a / at the beginning of your directory path.

/foo != yousite.com/foo in the system level.

hth,

Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] File upload problem

2004-09-04 Thread Jason Wong
On Saturday 04 September 2004 23:36, Dre wrote:
 I'm trying to upload a file using a form

  $base_img_dir = http://localhost/app_images/;;

The destination directory/file has to be a path on the local filesystem.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I used to think that the brain was the most wonderful organ in
my body.  Then I realized who was telling me this.
-- Emo Phillips
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File upload problem

2004-09-04 Thread Dre
thanks Jason .. it worked

thanks again

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Saturday 04 September 2004 23:36, Dre wrote:
  I'm trying to upload a file using a form

   $base_img_dir = http://localhost/app_images/;;

 The destination directory/file has to be a path on the local filesystem.

 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 I used to think that the brain was the most wonderful organ in
 my body.  Then I realized who was telling me this.
 -- Emo Phillips
 */

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] File upload problem

2003-12-20 Thread Larry Brown
According to the documentation you have to have the maxfilesize tag before
the input tag.

-Original Message-
From: Dino Costantini [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 6:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] File upload problem


i'm trying to write a page which allows user to upload file. theese are my
sources but they didn't work, anyone could help me?
-form.html
form action=upload.php method=post enctype=multipart/form-data
input type=file name=upfile
input type=hidden name=MAX_FILE_SIZE value=1
input type=submit value=Invia il file
/form
upload.php---
?php
// QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
// DI PHP PRECEDENTI ALLA 4.1.0
if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;

/* VARIABILI DA SETTARE /
// Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
$upload_dir = $_SERVER[DOCUMENT_ROOT] . /esempi;

// Eventuale nuovo nome da dare al file uploadato
$new_name = ciao.dino;

// Se $new_name è vuota, il nome sarà lo stesso del file uploadato
$file_name = ($new_name) ? $new_name : $_FILES[upfile][name];

if(trim($_FILES[upfile][name]) == ) {
die(Non hai indicato il file da uploadare !);
}

if(@is_uploaded_file($_FILES[upfile][tmp_name])) {
@move_uploaded_file($_FILES[upfile][tmp_name], $upload_dir/$file_name)
or die(Impossibile spostare il file, controlla l'esistenza o i permessi
della directory
dove fare l'upload.);
} else {
die(Problemi nell'upload del file  . $_FILES[upfile][name]);
}

echo L'upload del file  . $_FILES[upfile][name] .  è avvenuto
correttamente;

?
---
upload.php doesn't upload anything and doesn't output any error message. i
don't think it's an apache problem, because this is the only page that
doesn't work.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File upload problem

2003-12-18 Thread Blake Schroeder
This works for me

My Form

?php

?

form enctype=multipart/form-data action=savefile.php method=POST
input type=hidden name=MAX_FILE_SIZE value=10
Send this file: input name=filename type=file
input type=submit value=Send File
/form
savefile.php
?php
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
// $_FILES.  In PHP earlier then 4.0.3, use copy() and is_uploaded_file()
// instead of move_uploaded_file
$uploaddir = '/fullDirectoryPath';
$uploadfile = $uploaddir. $_FILES['filename']['name'];
print pre;
if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) {
 print File is valid, and was successfully uploaded. ;
 print Here's some more debugging info:\n;
 print_r($_FILES);
} else {
 print Possible file upload attack!  Here's some debugging info:\n;
 print_r($_FILES);
}
print /pre;
?

Dino Costantini wrote:

i'm trying to write a page which allows user to upload file. theese are my
sources but they didn't work, anyone could help me?
-form.html
form action=upload.php method=post enctype=multipart/form-data
input type=file name=upfile
input type=hidden name=MAX_FILE_SIZE value=1
input type=submit value=Invia il file
/form
upload.php---
?php
// QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
// DI PHP PRECEDENTI ALLA 4.1.0
if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
/* VARIABILI DA SETTARE /
// Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
$upload_dir = $_SERVER[DOCUMENT_ROOT] . /esempi;
// Eventuale nuovo nome da dare al file uploadato
$new_name = ciao.dino;
// Se $new_name è vuota, il nome sarà lo stesso del file uploadato
$file_name = ($new_name) ? $new_name : $_FILES[upfile][name];
if(trim($_FILES[upfile][name]) == ) {
die(Non hai indicato il file da uploadare !);
}
if(@is_uploaded_file($_FILES[upfile][tmp_name])) {
@move_uploaded_file($_FILES[upfile][tmp_name], $upload_dir/$file_name)
or die(Impossibile spostare il file, controlla l'esistenza o i permessi
della directory
dove fare l'upload.);
} else {
die(Problemi nell'upload del file  . $_FILES[upfile][name]);
}
echo L'upload del file  . $_FILES[upfile][name] .  è avvenuto
correttamente;
?
---
upload.php doesn't upload anything and doesn't output any error message. i
don't think it's an apache problem, because this is the only page that
doesn't work.
 

--

+-+-++
| Blake Schroeder | Owner/Developer |lhwd.net|
+--(http://www.lhwd.net)+--/3174026352\--+
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] File Upload problem

2003-10-20 Thread Grant Rutherford
I've tried a few more things, still with no success.  Increasing 
post_max_size and upload_max_filesize to 100M doesn't fix the 
problem.  Turning error logging on doesn't seem to catch any errors.  Is 
it possible that this is a problem with apache, and if so how should I 
go about fixing it?

Thanks,
Grant
Grant Rutherford wrote:

Hi there,

I'm trying to get a file upload to work with PHP.

The file I'm attempting to upload is a 742kB pdf file, but this will 
have to work for files up to 50Mb of all types eventually.

The following test pages work fine if the receiving page (testdone) is 
saved with an html extension, but they return a Document Contains no 
Data error if it has a php extension.  The inclusion or exclusion of 
a MAX_FILE_SIZE hidden field does not seem to effect the situation.

In addition, the upload appears to work fine for smaller files. (239kB 
works fine on both .php and .html)

I'm using PHP with apache viewed on Mozilla, and the following simple 
HTML:

teststart.html:
HTMLHEADTITLETest Page/TITLE/HEAD
BODY
H1 ALIGN=CENTERTest Page/H1
FORM ACTION='testdone.***' METHOD=POST NAME=aform 
ENCTYPE='multipart/form-data'
P ALIGN=CENTERINPUT TYPE=FILE NAME=testfileINPUT TYPE=SUBMIT 
NAME=add VALUE='Submit'/P
/FORM
/BODY
/HTML

testdone.***:
HTMLHEADTITLETest Page/TITLE/HEAD
BODY
H1 ALIGN=CENTERTest Page/H1
P ALIGN=CENTERFile Upload Successful/P
/BODY
/HTML
The parts of my php.ini file that I think may be relevant are:

memory_limit = 80M
post_max_size = 1M
file_uploads = On
upload_max_filesize = 1M
Any help would be appreciated

Thanks,
Grant





--
Grant Rutherford
Iders Incorporated
600A Clifton Street
Winnipeg, MB
R3G 2X6
http://www.iders.ca
tel: 204-779-5400 ext 36
fax: 204-779-5444

Iders Incorporated: Confidential

Note: This message is intended solely for the use of the designated
recipient(s) and their appointed delegates, and may contain
confidential information.  Any unauthorized disclosure, copying or
distribution of its contents is strictly prohibited.  If you have
received this message in error, please destroy it and advise the sender
immediately by phone, Email or facsimile.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] File Upload problem

2003-10-20 Thread Jay Blanchard
[snip]
I've tried a few more things, still with no success.  Increasing 
post_max_size and upload_max_filesize to 100M doesn't fix the 
problem.  Turning error logging on doesn't seem to catch any errors.  Is

it possible that this is a problem with apache, and if so how should I 
go about fixing it?
[/snip]

Grant,

What version of PHP are you running, and at the risk of being redundant,
are you doing exactly what the manual says to do reguarding uploads? Try
that first, and then lets work from there.

Jay

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload problem

2003-10-20 Thread Grant Rutherford
Hi there,

I'm running PHP version 4.2.2

I included all of my code in my origional post.  If you would like it 
reposted, I can do that.  I retried it with exactly the same code as the 
manual has in the file uploads section (cut and paste).  I'm merely 
trying to get the upload to work, I'm not concerned about handling the 
file yet!  If I can get the second page to load, then I could move the 
file, rename it or whatever, but it keeps returning The document 
contains no data and as far as I know the php script isn't even run.

Thanks,
Grant
Jay Blanchard wrote:

Grant,

What version of PHP are you running, and at the risk of being redundant,
are you doing exactly what the manual says to do reguarding uploads? Try
that first, and then lets work from there.
Jay

 



--
Grant Rutherford
Iders Incorporated
600A Clifton Street
Winnipeg, MB
R3G 2X6
http://www.iders.ca
tel: 204-779-5400 ext 36
fax: 204-779-5444

Iders Incorporated: Confidential

Note: This message is intended solely for the use of the designated
recipient(s) and their appointed delegates, and may contain
confidential information.  Any unauthorized disclosure, copying or
distribution of its contents is strictly prohibited.  If you have
received this message in error, please destroy it and advise the sender
immediately by phone, Email or facsimile.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] File Upload problem

2003-10-20 Thread Jay Blanchard
[snip]
I included all of my code in my origional post.  If you would like it 
reposted, I can do that.  I retried it with exactly the same code as the

manual has in the file uploads section (cut and paste).  I'm merely 
trying to get the upload to work, I'm not concerned about handling the 
file yet!  If I can get the second page to load, then I could move the 
file, rename it or whatever, but it keeps returning The document 
contains no data and as far as I know the php script isn't even run.
[/snip]

Moving the file is a requisite to the upload operation as PHP stores the
upload in a temp directory and deletes it quickly once the upload is
complete;

from http://us4.php.net/manual/en/features.file-upload.php

 The file will be deleted from the temporary directory at the end of
the request if it has not been moved away or renamed.

So, you may be uploading the file...and then deleting it. Your original
posted code did not contain the code for handling the upload, which is
on page 2 I guess?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload problem

2003-10-20 Thread Grant Rutherford
I found the problem!!!

Buried deep within the manual:

LimitRequestBody
in
/etc/httpd/conf.d/php.conf
was set too small.

Thanks for your time everyone,
Grant
--
Grant Rutherford
Iders Incorporated
600A Clifton Street
Winnipeg, MB
R3G 2X6
http://www.iders.ca
tel: 204-779-5400 ext 36
fax: 204-779-5444

Iders Incorporated: Confidential

Note: This message is intended solely for the use of the designated
recipient(s) and their appointed delegates, and may contain
confidential information.  Any unauthorized disclosure, copying or
distribution of its contents is strictly prohibited.  If you have
received this message in error, please destroy it and advise the sender
immediately by phone, Email or facsimile.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] file upload problem

2003-08-23 Thread Jim Lucas
when you are uploading files via a form, you must use the POST method.

Jim Lucas
- Original Message - 
From: Matthias Wulkow [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 23, 2003 11:16 AM
Subject: [PHP] file upload problem


 Hi ,
 
 I try to upload a file with such an input type = 'file' field.
 My form looks like:
 
 echo form action = '. $_SERVER[PHP_SELF].' method = 'GET' enctype
 = 'multipart/form-data'\n; 
 
 ...
 
 echo tdinput type = 'file' name = 'newtextupload'
 accept='text/*'/td\n; 
 
 ...
 
 echo tdinput type = 'submit' name = 'submit' value =
 'auml;ndern'/td\n;
 
 echo /form\n;
 
 After submition, I can't find the file on the server. Nowhere.
 In php.ini, I have /tmp as upload-directory.
 
 I'm using apache2 on linux.
 
 Can somebody tell me why the file is not uploaded?
 
 Thx for answering
 
 SvT
 
 
 -- 
 Who is the ennemy?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file upload problem

2003-08-23 Thread Matthias Wulkow
Hallo Jim,

am Samstag, 23. August 2003 um 21:16 hast Du Folgendes gekritzelt:

JL when you are uploading files via a form, you must use the POST method.

well, I tried the example from 
http://de.php.net/manual/de/features.file-upload.php#features.file-upload.post-method
and that doesn't work neither... no files are uploaded...


SvT

PS: In between I tried with POST and no success



-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file upload problem

2003-08-23 Thread Jim Lucas
- Original Message - 
From: Matthias Wulkow [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Jim Lucas [EMAIL PROTECTED]
Sent: Saturday, August 23, 2003 12:27 PM
Subject: Re: [PHP] file upload problem


 Hallo Jim,

 am Samstag, 23. August 2003 um 21:16 hast Du Folgendes gekritzelt:

 JL when you are uploading files via a form, you must use the POST method.

 well, I tried the example from
http://de.php.net/manual/de/features.file-upload.php#features.file-upload.post-method
 and that doesn't work neither... no files are uploaded...


 SvT

 PS: In between I tried with POST and no success



 -- 
 Who is the ennemy?

 mailto:[EMAIL PROTECTED]



how are you checking to see if the files are getting uploaded?

Jim Lucas

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file upload problem

2003-08-23 Thread Matthias Wulkow
Hallo Jim,

am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:


JL how are you checking to see if the files are getting uploaded?

JL Jim Lucas


I'm looking in /tmp for new files... but there are none. I'm also
looking in the Apache-RootDirectory. No files neither.

SvT



-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file upload problem

2003-08-23 Thread Jim Lucas
ok.  the key here then is that php is going to erase the uploaded file after
the script has finished processing.

What you have to do is move the file to a different location before the
script ends.

This is the normal behavor for PHP.

More then likely the file is getting transmitted to the server, but when the
script ends php automatically does some cleanup and erases any leftover
files.  Since you didn't move the file, it thinks that it is leftover and
just erases it.

Try moving the file or renaming it in some mannor and you will notice that
the file stays on the server even after the script ends.

Jim Lucas
- Original Message - 
From: Matthias Wulkow [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Jim Lucas [EMAIL PROTECTED]
Sent: Saturday, August 23, 2003 12:43 PM
Subject: Re: [PHP] file upload problem


 Hallo Jim,

 am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:


 JL how are you checking to see if the files are getting uploaded?

 JL Jim Lucas


 I'm looking in /tmp for new files... but there are none. I'm also
 looking in the Apache-RootDirectory. No files neither.

 SvT



 -- 
 Who is the ennemy?

 mailto:[EMAIL PROTECTED]

 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file upload problem

2003-08-23 Thread Matthias Nothhaft
Did you get any error (displayed/logged) ?

Test it like that:

print_r($_FILES) // with php  4.1 use $HTTP_POST_FILES

Now you can find your file at ...['tmp_name']

See also the php manual ;-)

Regards,
Matthias
Matthias Wulkow wrote:
Hallo Jim,

am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:

JL how are you checking to see if the files are getting uploaded?

JL Jim Lucas

I'm looking in /tmp for new files... but there are none. I'm also
looking in the Apache-RootDirectory. No files neither.
SvT



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] File upload problem - permission denied

2003-02-27 Thread Niklas Lampén
Seems that php does not have write access to that directory. Set it right
and it should work.


Niklas


P.S. Tip: It's much quicker to create plain html without echo. Just do it
like
form name=blah, not like
? echo form name=\blah\; ? :)


-Original Message-
From: Frans Bakker [mailto:[EMAIL PROTECTED] 
Sent: 27. helmikuuta 2003 15:43
To: [EMAIL PROTECTED]
Subject: [PHP] File upload problem - permission denied


Hello everybody,

I am relatively new to PHP and for quite some days I am trying to get a file
upload system going through a standard html form. To test it I use an html
page called Test2.php with a form in it with
enctype=\multipart/form-data\. Here is the source code:

?php

$AppImageDir = Web/Images;

if (isset($_FILES[ImageFile])) {
move_uploaded_file($_FILES['ImageFile']['tmp_name'],
$AppImageDir./.$_FILES['ImageFile']['name']);

}

?

html
head
titleWeb site - pages form/title
/head
body
?php

echo 
form action=\Test2.php\ enctype=\multipart/form-data\ method=\post\
input type=\hidden\ name=\MAX_FILE_SIZE\ value=\8\ input
type=\file\ name=\ImageFile\ input type=\submit\ name=\btnSubmit\
value=\Upload\ /form ; ?

/body
/html

It is a standard straight forward image upload situation. You see that the
form directs to itself (action=\Test2.php\) and on top of the page a
simple instruction to see if the file uploads correctly. As far as I can
see, this is correct code. Note that the any \\ are to escape  and further
\\ (necesary in echo  statements).

However, when I execute the page, I get the following error messages:

Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied
in /Web/Test2.php on line 6

Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg'
in /Web/Test2.php on line 6

It seems to say that I don't have permission to execute a file upload on
that page. As you can see by the directory specifications this script runs
on a Linux. However, I also tried the same script on a Windows machine, with
the corresponding directory specifications of course, and with the same
result: permission denied.

What is wrong here, where do I set what type of permissions in order to get
the file upload to work? By the way, in the php.ini FileUpload is set at
yes.

Kind regards,
FRANS BAKKER




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File upload problem - permission denied

2003-02-27 Thread Frans Bakker
All right then. ¿Where do I set that permission for PHP? On my local Windows
machine it is usually in IIS. However the whole ..\inetpub\wwwroot\..
directory already has read and write permissions. Apart from PHP I use Cold
Fusion. With Cold Fusion I don't have any permission problems...

Niklas lampén [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
Seems that php does not have write access to that directory. Set it right
and it should work.


Niklas


P.S. Tip: It's much quicker to create plain html without echo. Just do it
like
form name=blah, not like
? echo form name=\blah\; ? :)


-Original Message-
From: Frans Bakker [mailto:[EMAIL PROTECTED]
Sent: 27. helmikuuta 2003 15:43
To: [EMAIL PROTECTED]
Subject: [PHP] File upload problem - permission denied


Hello everybody,

I am relatively new to PHP and for quite some days I am trying to get a file
upload system going through a standard html form. To test it I use an html
page called Test2.php with a form in it with
enctype=\multipart/form-data\. Here is the source code:

?php

$AppImageDir = Web/Images;

if (isset($_FILES[ImageFile])) {
move_uploaded_file($_FILES['ImageFile']['tmp_name'],
$AppImageDir./.$_FILES['ImageFile']['name']);

}

?

html
head
titleWeb site - pages form/title
/head
body
?php

echo 
form action=\Test2.php\ enctype=\multipart/form-data\ method=\post\
input type=\hidden\ name=\MAX_FILE_SIZE\ value=\8\ input
type=\file\ name=\ImageFile\ input type=\submit\ name=\btnSubmit\
value=\Upload\ /form ; ?

/body
/html

It is a standard straight forward image upload situation. You see that the
form directs to itself (action=\Test2.php\) and on top of the page a
simple instruction to see if the file uploads correctly. As far as I can
see, this is correct code. Note that the any \\ are to escape  and further
\\ (necesary in echo  statements).

However, when I execute the page, I get the following error messages:

Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied
in /Web/Test2.php on line 6

Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg'
in /Web/Test2.php on line 6

It seems to say that I don't have permission to execute a file upload on
that page. As you can see by the directory specifications this script runs
on a Linux. However, I also tried the same script on a Windows machine, with
the corresponding directory specifications of course, and with the same
result: permission denied.

What is wrong here, where do I set what type of permissions in order to get
the file upload to work? By the way, in the php.ini FileUpload is set at
yes.

Kind regards,
FRANS BAKKER




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] File upload problem - permission denied

2003-02-27 Thread Niklas Lampén
On linux you can do it in shell with chmod command. Do 'chmod 766 direcory'.
You can find out more about chmod-command at
http://www.die.net/doc/linux/man/man1/chmod.1.html.


Niklas


-Original Message-
From: Frans Bakker [mailto:[EMAIL PROTECTED] 
Sent: 27. helmikuuta 2003 16:03
To: [EMAIL PROTECTED]
Subject: Re: [PHP] File upload problem - permission denied


All right then. ¿Where do I set that permission for PHP? On my local Windows
machine it is usually in IIS. However the whole ..\inetpub\wwwroot\..
directory already has read and write permissions. Apart from PHP I use Cold
Fusion. With Cold Fusion I don't have any permission problems...

Niklas lampén [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
Seems that php does not have write access to that directory. Set it right
and it should work.


Niklas


P.S. Tip: It's much quicker to create plain html without echo. Just do it
like form name=blah, not like ? echo form name=\blah\; ? :)


-Original Message-
From: Frans Bakker [mailto:[EMAIL PROTECTED]
Sent: 27. helmikuuta 2003 15:43
To: [EMAIL PROTECTED]
Subject: [PHP] File upload problem - permission denied


Hello everybody,

I am relatively new to PHP and for quite some days I am trying to get a file
upload system going through a standard html form. To test it I use an html
page called Test2.php with a form in it with
enctype=\multipart/form-data\. Here is the source code:

?php

$AppImageDir = Web/Images;

if (isset($_FILES[ImageFile])) {
move_uploaded_file($_FILES['ImageFile']['tmp_name'],
$AppImageDir./.$_FILES['ImageFile']['name']);

}

?

html
head
titleWeb site - pages form/title
/head
body
?php

echo 
form action=\Test2.php\ enctype=\multipart/form-data\ method=\post\
input type=\hidden\ name=\MAX_FILE_SIZE\ value=\8\ input
type=\file\ name=\ImageFile\ input type=\submit\ name=\btnSubmit\
value=\Upload\ /form ; ?

/body
/html

It is a standard straight forward image upload situation. You see that the
form directs to itself (action=\Test2.php\) and on top of the page a
simple instruction to see if the file uploads correctly. As far as I can
see, this is correct code. Note that the any \\ are to escape  and further
\\ (necesary in echo  statements).

However, when I execute the page, I get the following error messages:

Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied
in /Web/Test2.php on line 6

Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg'
in /Web/Test2.php on line 6

It seems to say that I don't have permission to execute a file upload on
that page. As you can see by the directory specifications this script runs
on a Linux. However, I also tried the same script on a Windows machine, with
the corresponding directory specifications of course, and with the same
result: permission denied.

What is wrong here, where do I set what type of permissions in order to get
the file upload to work? By the way, in the php.ini FileUpload is set at
yes.

Kind regards,
FRANS BAKKER




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


###
This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
more information, connect to http://www.F-Secure.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File upload problem - permission denied

2003-02-27 Thread 1LT John W. Holmes
Make sure whatever user the _web server_ is running as has access to write
to that directory.

With IIS, this is the IUSR_computer_name account.

 $AppImageDir = Web/Images;

You've got a error in that line, also, hopefully it's just a typo, though.

---John Holmes...

- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: Php-General [EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 9:07 AM
Subject: RE: [PHP] File upload problem - permission denied


On linux you can do it in shell with chmod command. Do 'chmod 766 direcory'.
You can find out more about chmod-command at
http://www.die.net/doc/linux/man/man1/chmod.1.html.


Niklas


-Original Message-
From: Frans Bakker [mailto:[EMAIL PROTECTED]
Sent: 27. helmikuuta 2003 16:03
To: [EMAIL PROTECTED]
Subject: Re: [PHP] File upload problem - permission denied


All right then. ¿Where do I set that permission for PHP? On my local Windows
machine it is usually in IIS. However the whole ..\inetpub\wwwroot\..
directory already has read and write permissions. Apart from PHP I use Cold
Fusion. With Cold Fusion I don't have any permission problems...

Niklas lampén [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
Seems that php does not have write access to that directory. Set it right
and it should work.


Niklas


P.S. Tip: It's much quicker to create plain html without echo. Just do it
like form name=blah, not like ? echo form name=\blah\; ? :)


-Original Message-
From: Frans Bakker [mailto:[EMAIL PROTECTED]
Sent: 27. helmikuuta 2003 15:43
To: [EMAIL PROTECTED]
Subject: [PHP] File upload problem - permission denied


Hello everybody,

I am relatively new to PHP and for quite some days I am trying to get a file
upload system going through a standard html form. To test it I use an html
page called Test2.php with a form in it with
enctype=\multipart/form-data\. Here is the source code:

?php

$AppImageDir = Web/Images;

if (isset($_FILES[ImageFile])) {
move_uploaded_file($_FILES['ImageFile']['tmp_name'],
$AppImageDir./.$_FILES['ImageFile']['name']);

}

?

html
head
titleWeb site - pages form/title
/head
body
?php

echo 
form action=\Test2.php\ enctype=\multipart/form-data\ method=\post\
input type=\hidden\ name=\MAX_FILE_SIZE\ value=\8\ input
type=\file\ name=\ImageFile\ input type=\submit\ name=\btnSubmit\
value=\Upload\ /form ; ?

/body
/html

It is a standard straight forward image upload situation. You see that the
form directs to itself (action=\Test2.php\) and on top of the page a
simple instruction to see if the file uploads correctly. As far as I can
see, this is correct code. Note that the any \\ are to escape  and further
\\ (necesary in echo  statements).

However, when I execute the page, I get the following error messages:

Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied
in /Web/Test2.php on line 6

Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg'
in /Web/Test2.php on line 6

It seems to say that I don't have permission to execute a file upload on
that page. As you can see by the directory specifications this script runs
on a Linux. However, I also tried the same script on a Windows machine, with
the corresponding directory specifications of course, and with the same
result: permission denied.

What is wrong here, where do I set what type of permissions in order to get
the file upload to work? By the way, in the php.ini FileUpload is set at
yes.

Kind regards,
FRANS BAKKER




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


###
This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
more information, connect to http://www.F-Secure.com/



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File upload problem

2003-02-18 Thread Manuel Ochoa

There may be several reasons why it doesn't work but the first thing I noticed is that 
action is blank. You need to have this defined.
 John M [EMAIL PROTECTED] wrote:Hello,

I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir
is c:\tmp\ and upload_max_filesize is 2M in PHP config file.

Thanks!










 [input] 
 [input] 

echo Before submit 
\n;
if(isset( $Submit ))
{
echo After submit 
\n;

if ($_FILES['imagefile']['type'] == image/gif){
copy ($_FILES['imagefile']['tmp_name'],
files/.$_FILES['imagefile']['name'])
or die (Could not copy);
echo Name: .$_FILES['imagefile']['name'].;
}
else {
echo ;
echo Could Not Copy, Wrong Filetype
(.$_FILES['imagefile']['name'].);
}
}
?







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





~ Manuel Ochoa ~
Seven days is too long to wait for a gun!



RE: [PHP] File upload problem

2003-02-18 Thread Chris McCluskey
Try 

if(isset($_REQUEST[Submit]))

If that doesn't work, perhaps you could just diagnose this by
print_r'ing the variables you are getting from the form:

(at the very top of your code, put):
die(print_r($_REQUEST));

-Chris

-Original Message-
From: Manuel Ochoa [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 18, 2003 7:04 AM
To: John M; [EMAIL PROTECTED]
Subject: Re: [PHP] File upload problem



There may be several reasons why it doesn't work but the first thing I
noticed is that action is blank. You need to have this defined.
 John M [EMAIL PROTECTED] wrote:Hello,

I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But
after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on ,
upload_tmp_dir
is c:\tmp\ and upload_max_filesize is 2M in PHP config file.

Thanks!










 [input] 
 [input] 

echo Before submit 
\n;
if(isset( $Submit ))
{
echo After submit 
\n;

if ($_FILES['imagefile']['type'] == image/gif){
copy ($_FILES['imagefile']['tmp_name'],
files/.$_FILES['imagefile']['name'])
or die (Could not copy);
echo Name: .$_FILES['imagefile']['name'].;
}
else {
echo ;
echo Could Not Copy, Wrong Filetype
(.$_FILES['imagefile']['name'].);
}
}
?







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





~ Manuel Ochoa ~
Seven days is too long to wait for a gun!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2003-02-10 Thread Gurhan Ozen
On Sun, 2003-02-09 at 19:43, Jason Wong wrote:
 On Monday 10 February 2003 05:56, Gurhan Ozen wrote:
 
  You need to specifye the MAX_FILE_SIZE value as a hidden argument to the
  form..
  See: http://www.php.net/manual/en/features.file-upload.php
 
 You don't. 
 
 If you can show otherwise please post details to the list.
 

Hi Jason, 
I remember reading it on the book PHP and MySQL Web development book
by Luke Welling and Laura Thompson. I just checked the book again, on
page 353, when explaining file upload it reads You must have a form
field that sets the maximum size file that can be uploaded. Then it
says The name of this form field must be MAX_FILE_SIZE.
Also in the PHP manual which can be seen at:
http://www.php.net/manual/en/features.file-upload.php, it reads:
 The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field
must precede the file input field and its value is the maximum filesize
accepted. The value is in bytes.
Which sounds like it has to be there to me? I just checked a working
file upload form without MAX_FILE_SIZE field, and it worked.. I guess i
misunderstood what was on the tutorials ? Or i wonder if this was a must
in the earlier versions of PHP? Anyone?
And thanks for correcting me..
Gurhan
   
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 To keep your friends treat them kindly; to kill them, treat them often.
 */
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] File upload problem

2003-02-10 Thread Dennis Cole
MAX_FILE_SIZE only tells the browser how large the file should be. This is
why the PHP manual page also says, The MAX_FILE_SIZE is advisory to the
browser. It is easy to circumvent this maximum. So don't count on it that
the browser obeys your wish! The PHP-settings for maximum-size, however,
cannot be fooled. 

-Original Message-
From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 10, 2003 9:50 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] File upload problem


On Sun, 2003-02-09 at 19:43, Jason Wong wrote:
 On Monday 10 February 2003 05:56, Gurhan Ozen wrote:

  You need to specifye the MAX_FILE_SIZE value as a hidden argument to the
  form..
  See: http://www.php.net/manual/en/features.file-upload.php

 You don't.

 If you can show otherwise please post details to the list.


Hi Jason,
I remember reading it on the book PHP and MySQL Web development book
by Luke Welling and Laura Thompson. I just checked the book again, on
page 353, when explaining file upload it reads You must have a form
field that sets the maximum size file that can be uploaded. Then it
says The name of this form field must be MAX_FILE_SIZE.
Also in the PHP manual which can be seen at:
http://www.php.net/manual/en/features.file-upload.php, it reads:
 The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field
must precede the file input field and its value is the maximum filesize
accepted. The value is in bytes.
Which sounds like it has to be there to me? I just checked a working
file upload form without MAX_FILE_SIZE field, and it worked.. I guess i
misunderstood what was on the tutorials ? Or i wonder if this was a must
in the earlier versions of PHP? Anyone?
And thanks for correcting me..
Gurhan

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 To keep your friends treat them kindly; to kill them, treat them often.
 */


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2003-02-10 Thread Pag



Which sounds like it has to be there to me? I just checked a working
file upload form without MAX_FILE_SIZE field, and it worked.. I guess i
misunderstood what was on the tutorials ? Or i wonder if this was a must
in the earlier versions of PHP? Anyone?


I have an upload feature on my administration side of my site and 
i dont use the MAX_FILE_SIZE as a hidden field on the form. I simply have a 
field for the file to upload and do all the checks, for size, change 
filename, etc, on the receiving end (different script) and it works fine.
If you want the code, i can send it to you or post it here. :-)

Pag 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File upload problem

2003-02-09 Thread Gurhan Ozen
Hi, 
You need to specifye the MAX_FILE_SIZE value as a hidden argument to the
form.. 
See: http://www.php.net/manual/en/features.file-upload.php

Gurhan

On Mon, 2003-06-30 at 15:05, John M wrote:
 Hello,
 
 I have the code below. It's a simple file upload. But it doesn't work.
 Before the line if(isset( $Submit )) is an echo which can I read. But after
 choosing a file and press a submit nothing happens. Why is if(isset(
 $Submit )) always false? Maybe my apache or php config is wrong?
 
 I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir
 is c:\tmp\ and upload_max_filesize is 2M in PHP config file.
 
 Thanks!
 
 
 html
 head
 titleUntitled Document/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head
 body
 
 form name=form1 method=post action= enctype=multipart/form-data
 input type=file name=imagefile
 input type=submit name=Submit value=Submit
 
 ?
 echo Before submit br\n;
 if(isset( $Submit ))
 {
 echo After submit br\n;
 
 if ($_FILES['imagefile']['type'] == image/gif){
 copy ($_FILES['imagefile']['tmp_name'],
 files/.$_FILES['imagefile']['name'])
 or die (Could not copy);
 echo Name: .$_FILES['imagefile']['name'].;
}
  else {
 echo ;
 echo Could Not Copy, Wrong Filetype
 (.$_FILES['imagefile']['name'].);
 }
 }
 ?
 /form
 
 /body
 /html
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2003-02-09 Thread David Rice
Hi John:
Well actually I believe that you don't have to set MAX_FILE_SIZE...(I 
don't)
but you might want make sure that you are not trying to send a file 
larger than the post_max_size directives in php.ini and ensure that 
file_uploads is set to allow http uploads.

On Sunday, February 9, 2003, at 04:56 PM, Gurhan Ozen wrote:

Hi,
You need to specifye the MAX_FILE_SIZE value as a hidden argument to 
the
form..
See: http://www.php.net/manual/en/features.file-upload.php

Gurhan

On Mon, 2003-06-30 at 15:05, John M wrote:
Hello,

I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But 
after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , 
upload_tmp_dir
is c:\tmp\ and upload_max_filesize is 2M in PHP config file.

Thanks!


html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; 
charset=iso-8859-1
/head
body

form name=form1 method=post action= 
enctype=multipart/form-data
input type=file name=imagefile
input type=submit name=Submit value=Submit

?
echo Before submit br\n;
if(isset( $Submit ))
{
echo After submit br\n;

if ($_FILES['imagefile']['type'] == image/gif){
copy ($_FILES['imagefile']['tmp_name'],
files/.$_FILES['imagefile']['name'])
or die (Could not copy);
echo Name: .$_FILES['imagefile']['name'].;
   }
 else {
echo ;
echo Could Not Copy, Wrong Filetype
(.$_FILES['imagefile']['name'].);
}
}
?
/form

/body
/html



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2003-02-09 Thread Jason Wong
On Monday 10 February 2003 05:56, Gurhan Ozen wrote:

 You need to specifye the MAX_FILE_SIZE value as a hidden argument to the
 form..
 See: http://www.php.net/manual/en/features.file-upload.php

You don't. 

If you can show otherwise please post details to the list.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
To keep your friends treat them kindly; to kill them, treat them often.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2003-02-01 Thread David Rice

On Saturday, February 1, 2003, at 10:58 AM, Tomator wrote:


I tried but I can't upload any file. My form and code are as following:



Try looking at:
http://www.php.net/manual/en/features.file-upload.php
There is a working example there.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] File upload problem

2003-01-21 Thread Edward Peloke
John,

I have Win 98 with Apache 2 and it worked fine for me, once I commented out
the file type check, didn't seem to like any file I tried, even gifs.  I
also had to create a folder named 'files' under my htdocs folder in apache.


Eddie

-Original Message-
From: John M [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 30, 2003 3:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] File upload problem


Hello,

I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir
is c:\tmp\ and upload_max_filesize is 2M in PHP config file.

Thanks!


html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
body

form name=form1 method=post action= enctype=multipart/form-data
input type=file name=imagefile
input type=submit name=Submit value=Submit

?
echo Before submit br\n;
if(isset( $Submit ))
{
echo After submit br\n;

if ($_FILES['imagefile']['type'] == image/gif){
copy ($_FILES['imagefile']['tmp_name'],
files/.$_FILES['imagefile']['name'])
or die (Could not copy);
echo Name: .$_FILES['imagefile']['name'].;
   }
 else {
echo ;
echo Could Not Copy, Wrong Filetype
(.$_FILES['imagefile']['name'].);
}
}
?
/form

/body
/html



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] File upload problem

2003-01-21 Thread Matt Schroebel
 -Original Message-
 From: John M [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, June 30, 2003 3:05 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] File upload problem
 
 
 Hello,
 
 I have the code below. It's a simple file upload. But it doesn't work.
 Before the line if(isset( $Submit )) is an echo which can I 
 read. But after
 choosing a file and press a submit nothing happens. Why is if(isset(
 $Submit )) always false? Maybe my apache or php config is wrong?

Shouldn't you be looking at $_POST['Submit'] or do you have
register_globals turned on?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File Upload problem

2002-11-12 Thread Ernest E Vogelsinger
At 00:25 13.11.2002, Van Andel, Robert said:
[snip] 
FORM action=? echo $PHP_SELF; ? method=post 
encType=multipart/form-dataINPUT type=hidden value=2
name=MAX_FILE_SIZE 
INPUT type=file name=users_fileBRINPUT type=submit value=Upload!
/FORM?PHP
 }
?
When I submit the form at the bottom of the script, the $user_file variable
equals none.  I am unable to figure out what is going on.  The variable
$users_file_name lists the file's name, but the $user_file is none and the
$user_file_size =0. 
 
Why is $user_file equal to none?  Any help will be greatly appreciated. 
[snip] 

Try to use the name $users_file and $users_file_size (note the 's' after user).
Just in case that was no typo in your message...


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] File Upload problem

2002-11-12 Thread Van Andel, Robert
It was a typo.  Sorry.

Robbert van Andel 
=== 
Network Operator 
NW Regional Operations Center 
Charter Communications 
ROC Phone: 866-311-6646 
Desk Phone: 360-828-6727 
email: DL NW ROC 
=== 


-Original Message-
From: Ernest E Vogelsinger [mailto:ernest;vogelsinger.at]
Sent: Tuesday, November 12, 2002 3:46 PM
To: Van Andel, Robert
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] File Upload problem 


At 00:25 13.11.2002, Van Andel, Robert said:
[snip] 
FORM action=? echo $PHP_SELF; ? method=post 
encType=multipart/form-dataINPUT type=hidden value=2
name=MAX_FILE_SIZE 
INPUT type=file name=users_fileBRINPUT type=submit value=Upload!
/FORM?PHP
 }
?
When I submit the form at the bottom of the script, the $user_file variable
equals none.  I am unable to figure out what is going on.  The variable
$users_file_name lists the file's name, but the $user_file is none and the
$user_file_size =0. 
 
Why is $user_file equal to none?  Any help will be greatly appreciated. 
[snip] 

Try to use the name $users_file and $users_file_size (note the 's' after
user).
Just in case that was no typo in your message...


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



 The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers. 





RE: [PHP] File Upload problem

2002-11-12 Thread Van Andel, Robert
Upon reading my reply, I think perhaps I wasn't clear enough.  I am using
users_file, etc.  I am unable to upload a file because $users_file is given
the value of none.


-Original Message-
From: Van Andel, Robert 
Sent: Tuesday, November 12, 2002 3:59 PM
To: Ernest E Vogelsinger
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] File Upload problem 


It was a typo.  Sorry.

-Original Message-
From: Ernest E Vogelsinger [mailto:ernest;vogelsinger.at]
Sent: Tuesday, November 12, 2002 3:46 PM
To: Van Andel, Robert
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] File Upload problem 


At 00:25 13.11.2002, Van Andel, Robert said:
[snip] 
FORM action=? echo $PHP_SELF; ? method=post 
encType=multipart/form-dataINPUT type=hidden value=2
name=MAX_FILE_SIZE 
INPUT type=file name=users_fileBRINPUT type=submit value=Upload!
/FORM?PHP
 }
?
When I submit the form at the bottom of the script, the $user_file variable
equals none.  I am unable to figure out what is going on.  The variable
$users_file_name lists the file's name, but the $user_file is none and the
$user_file_size =0. 
 
Why is $user_file equal to none?  Any help will be greatly appreciated. 
[snip] 

Try to use the name $users_file and $users_file_size (note the 's' after
user).
Just in case that was no typo in your message...


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



 The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers. 




 The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers. 





Re: [PHP] File upload problem...

2002-10-29 Thread Marek Kilimajer
Try print_r($_FILES) and see if you really get what you should. And also 
check if you have your
form set as
form enctype=multipart/form-data action= url  method=POST


David Russell wrote:

Hi all,

I have a form with a file upload section. The target script contains the
following:

   if (is_uploaded_file($_FILES['newuserfile']['tmp_name']))  {
 AddAttachment($BPFNo, $newuserfile, $newuserfile_name,
$newuserfile_size, $newuserfile_type);
   }

AddAttachment() is an included function which works elsewhere.

When running this, I get the following error:
Notice: Undefined index: newuserfile in
c:\webpages\intranet\htmlroot\optimiza\bpf\updatebpf.php on line 77

And obviously, the attachment is not added.

Where can I look for info on the $_FILES global array, and start
narrowing down the problem.

One caveat - I currently have no internet access (e-mail only). Could
people please e-mail me information especially if they want to include
links to relevant websites.

Thanks

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com


 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] file upload problem

2002-05-19 Thread Rodney Davis

The purpose of the function is to upload a file.  It fails to upload
despite not generating an error.  I went into the php.ini file and found
that the max file size was defaulted to 2mb.  I increased this and it
fixed the problem.  

-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, May 18, 2002 7:31 PM
To: Rodney Davis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] file upload problem

On Sat, 18 May 2002, Rodney Davis wrote:
 I am trying to use the move_uploaded_file() function to upload files
to
 a specific directory. It works fine with small .jpgs .txt etc etc but
 won't work with a large .mp3 file.  Is this because it is too large?
 What can I do?

You can tell us what won't work means. Do the police come to your
door?

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] file upload problem

2002-05-18 Thread Miguel Cruz

On Sat, 18 May 2002, Rodney Davis wrote:
 I am trying to use the move_uploaded_file() function to upload files to
 a specific directory. It works fine with small .jpgs .txt etc etc but
 won't work with a large .mp3 file.  Is this because it is too large?
 What can I do?

You can tell us what won't work means. Do the police come to your door?

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] File upload problem

2002-05-07 Thread David Freeman


  -Original Message-
  I'm curious, I keep seeing people say that that tag is 
  /necessary/, but I've never had to use it in the upload forms 
  that I've built and they work just fine in Opera, NN  IE. 

Good question.  To be honest it's been a while since I looked, I built a
file upload function as part of a standard set of functions that I
include in projects and then stopped worrying about it.  As a result
it's been a some time since I looked at that sort of thing.  I recall
including it for a reason but don't exactly recall the reason.

  AFAICT from the manual that tag is only to advise the 
  browser to limit the size of the file being uploaded, 
  nothing to suggest that the absence of the 
  tag would prevent uploading.

I guess that anything that causes this sort of thing to happen on the
browser is going to help.  I know I'd be fairly unimpressed if I sat
waiting for a 2MB file to upload only to find that the limit is 1.5MB or
some such.  At least if a client-side limit is given the browser can do
something about it.

Not that I actually recall testing that either - I've so far only used
file upload capabilities on intranet projects where I have fully
switched 100MB and the like.

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2002-05-07 Thread Miguel Cruz

On Tue, 7 May 2002, Jason Wong wrote:
 INPUT TYPE=hidden name=MAX_FILE_SIZE value=2048000

 You actually _need_ that hidden tag set AFAIK.
 
 I'm curious, I keep seeing people say that that tag is /necessary/, but I've 
 never had to use it in the upload forms that I've built and they work just 
 fine in Opera, NN  IE. 

Don't feel bad - I never use it either and I'm still breathing.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2002-05-07 Thread Jason Wong

On Tuesday 07 May 2002 15:22, Miguel Cruz wrote:
 On Tue, 7 May 2002, Jason Wong wrote:
  INPUT TYPE=hidden name=MAX_FILE_SIZE value=2048000
 
  You actually _need_ that hidden tag set AFAIK.
 
  I'm curious, I keep seeing people say that that tag is /necessary/, but
  I've never had to use it in the upload forms that I've built and they
  work just fine in Opera, NN  IE.

 Don't feel bad - I never use it either and I'm still breathing.

A lot of people have reported on the list that their uploads didn't work 
until they added that tag. If any of these people are reading this could you 
confirm that that tag is really necessary? And what version of 
browser/webserver/php are you using?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The future isn't what it used to be.  (It never was.)
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2002-05-07 Thread Jason Wong

On Tuesday 07 May 2002 14:14, David Freeman wrote:

 I guess that anything that causes this sort of thing to happen on the
 browser is going to help.  I know I'd be fairly unimpressed if I sat
 waiting for a 2MB file to upload only to find that the limit is 1.5MB or
 some such.  At least if a client-side limit is given the browser can do
 something about it.

 Not that I actually recall testing that either - I've so far only used
 file upload capabilities on intranet projects where I have fully
 switched 100MB and the like.

Hmm, after a bit of testing I find that the MAX_FILE_SIZE tag is useless to 
say the least (probably because no browsers support it?)

In all of NN, Opera, IE having the tag does /not/ prevent the file from being 
uploaded. Thus if I set MAX_FILE_SIZE to 10 (100K) and upload a 5MB file 
what happens is:

1) you still have to wait for the whole 5MB to be uploaded
2) php sees the MAX_FILE_SIZE setting is exceeded then discards the file

If anyone wants to run their own tests here's my test script:

==
html
  body
form enctype=multipart/form-data action=? echo $z_PHP_SELF ? 
method=post
  input type=hidden name=MAX_FILE_SIZE value=100
  table border='0'
tr valign=top
  td align=rightGimme a file/td
  td align=leftinput type=file name=file size=60/td
/tr
  /table
  input type=submit name=action value=GO
/form
?
$file_size = $HTTP_POST_FILES['file']['size'];
$tmp_filename  = $HTTP_POST_FILES['file']['tmp_name'];
print_r($HTTP_POST_FILES);
?
  /body
/html
==

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You just wait, I'll sin till I blow up!
-- Dylan Thomas
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] File upload problem

2002-05-07 Thread David Freeman

  -Original Message-
  Hmm, after a bit of testing I find that the MAX_FILE_SIZE 
  tag is useless to say the least (probably because no browsers support
it?)

That's somewhat of a shame I guess but I can hardly claim to be
surprised - especially as I've just spent much of my time in the last
couple of days wrestling with browser rendering compatibility issues for
a client's web site - from which my only significant conclusion was that
Netscape sucks.

  1) you still have to wait for the whole 5MB to be uploaded
  2) php sees the MAX_FILE_SIZE setting is exceeded then 
  discards the file

An opportunity to do something lost - although I guess you might be able
to do some javascripting to achieve the same.  But then, that wouldn't
require you to have the hidden field either.

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2002-05-07 Thread Linn Kubler

I put the max file size tag into my code but that didn't help either.  What
looks like is happening is that the php file can't be found.  I'm using
phpscriptcenter's upload.php program and it is all in one script, if you
know what I mean.

What I'm seeing now is that, depending on the size of the file that I select
to upload, it doesn't look like the form is being processed correctly.  I
changed the action of the form to point to a simple html file and I get the
same results, page cannot be displayed.  But this only happens when I pick a
file that's 15MB or larger, pick a file that's smaller, in this case a few
KB, and it works as expected.  Not sure what to look for next.

Thanks for all the help,
Linn

David Freeman [EMAIL PROTECTED] wrote in message
002701c1f562$b1501460$[EMAIL PROTECTED]">news:002701c1f562$b1501460$[EMAIL PROTECTED]...

   -Original Message-

   INPUT TYPE=hidden name=MAX_FILE_SIZE value=2048000

 You actually _need_ that hidden tag set AFAIK.

 CYA, Dave





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2002-05-07 Thread Jason Wong

On Tuesday 07 May 2002 19:09, David Freeman wrote:
   -Original Message-
   Hmm, after a bit of testing I find that the MAX_FILE_SIZE
   tag is useless to say the least (probably because no browsers support

 it?)

 That's somewhat of a shame I guess but I can hardly claim to be
 surprised - especially as I've just spent much of my time in the last
 couple of days wrestling with browser rendering compatibility issues for
 a client's web site - from which my only significant conclusion was that
 Netscape sucks.

   1) you still have to wait for the whole 5MB to be uploaded
   2) php sees the MAX_FILE_SIZE setting is exceeded then
   discards the file

 An opportunity to do something lost - although I guess you might be able
 to do some javascripting to achieve the same.  But then, that wouldn't
 require you to have the hidden field either.

Done some more tests. The good news is that it seems that browsers can and do 
respect the limits set on the server (php.ini). For example in php.ini I set 
the post_max_size to 32M then when I upload a 33M file, the browser has a 
quick word with the server and ascertains that the file is over the limit and 
stops.

The bad news is that out of Opera, NN and IE only Opera works properly in 
this respect. NN uploads the file then gives Network Error: Connection reset 
by peer. IE uploads the file then gives Cannot find server, page cannot be 
displayed (!!).

These were quick and dirty tests and should not be taken as gospel.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
If a man has talent and cannot use it, he has failed.
-- Thomas Wolfe
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2002-05-07 Thread Jason Soza

For what it's worth, I ran into this the other day, except I'm not 
using the MAX_FILE_SIZE tag in the form. I have a variable set in the 
action script that is set to the max size in KB, I take the user's 
filesize, divide it by 1024 to get it to KB, then run an 'if' statement 
to decide whether to upload it or not.

Anyway, in my php.ini settings, I have a max size of 8M - when I tried 
uploading a 10M file using IE6, the script simply did not execute 
beyond the file upload stage, i.e. it didn't upload the entire file, 
then give me the 'Cannot find server...' page. If I can remember this 
correctly, it just went directly to a white screen, as if there were a 
parse error involved. I checked the error logs and it said that the 8M 
file limit was exceeded. But it did this without waiting for the entire 
file to be uploaded first.

Jason Soza

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
Date: Tuesday, May 7, 2002 8:49 am
Subject: Re: [PHP] File upload problem

 On Tuesday 07 May 2002 19:09, David Freeman wrote:
-Original Message-
Hmm, after a bit of testing I find that the MAX_FILE_SIZE
tag is useless to say the least (probably because no browsers 
 support
  it?)
 
  That's somewhat of a shame I guess but I can hardly claim to be
  surprised - especially as I've just spent much of my time in the 
 last couple of days wrestling with browser rendering 
 compatibility issues for
  a client's web site - from which my only significant conclusion 
 was that
  Netscape sucks.
 
1) you still have to wait for the whole 5MB to be uploaded
2) php sees the MAX_FILE_SIZE setting is exceeded then
discards the file
 
  An opportunity to do something lost - although I guess you might 
 be able
  to do some javascripting to achieve the same.  But then, that 
 wouldn't require you to have the hidden field either.
 
 Done some more tests. The good news is that it seems that browsers 
 can and do 
 respect the limits set on the server (php.ini). For example in 
 php.ini I set 
 the post_max_size to 32M then when I upload a 33M file, the 
 browser has a 
 quick word with the server and ascertains that the file is over 
 the limit and 
 stops.
 
 The bad news is that out of Opera, NN and IE only Opera works 
 properly in 
 this respect. NN uploads the file then gives Network Error: 
 Connection reset 
 by peer. IE uploads the file then gives Cannot find server, page 
 cannot be 
 displayed (!!).
 
 These were quick and dirty tests and should not be taken as gospel.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications 
 Development *
 
 /*
 If a man has talent and cannot use it, he has failed.
   -- Thomas Wolfe
 */


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2002-05-06 Thread Linn Kubler

D'oh!  You're right, I went back and checked php.ini and found
upload_max_filesize but it's already set to 200M, I'm assuming that means
200 MegaBytes.  So I don't think that's the problem.  I don't have the
hidden tag set in the page code so that shouldn't be a factor either, right?
I'm a real rooky at php programming.

Thanks for your tip, can you think of anything else to look at?
Linn

Francesc Leveque [EMAIL PROTECTED] wrote in message
00dd01c1f513$e20fbaf0$3b00a8c0@fleveque">news:00dd01c1f513$e20fbaf0$3b00a8c0@fleveque...
   I can remember there is an option on the php config file to set the max
file size when uploading...

   I think you can also limit the size with a hidden input on the form...
like this:

INPUT TYPE=hidden name=MAX_FILE_SIZE value=2048000
the value corresponds to the number of bytes. so this would be for 2 MB..

--
Francesc Leveque
Lavinia TC
Passatge Permanyer, 12
08009 Barcelona
Tel: 93 272 34 10
[EMAIL PROTECTED]
  - Original Message -
  From: Linn Kubler
  To: [EMAIL PROTECTED]
  Sent: Monday, May 06, 2002 5:29 PM
  Subject: [PHP] File upload problem


  Hi All,

  I have a script that uploads files via my browser.  Works fine under
RedHat
  7.0 but on a RH 7.2 server it crashes on files over at least 10MB.  Files
  under 3MB work fine.

  Any suggestions?  I've looked around for a php config file that might
  specify the max file size but so far have found nothing.  Could this be an
  imcompatibility on RH 7.2?

  Thanks in advance,
  Linn

  --
  Please remove the number two from domain name for email.



  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] File upload problem

2002-05-06 Thread David Freeman


  -Original Message-
  D'oh!  You're right, I went back and checked php.ini and 
  found upload_max_filesize but it's already set to 200M, I'm 
  assuming that means 200 MegaBytes.  So I don't think that's 
  the problem.  I don't have the hidden tag set in the page 
  code so that shouldn't be a factor either, right? I'm a real 
  rooky at php programming.
  -Original Message-

  INPUT TYPE=hidden name=MAX_FILE_SIZE value=2048000

You actually _need_ that hidden tag set AFAIK.

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File upload problem

2002-05-06 Thread Jason Wong

On Tuesday 07 May 2002 09:01, David Freeman wrote:
   -Original Message-
   D'oh!  You're right, I went back and checked php.ini and
   found upload_max_filesize but it's already set to 200M, I'm
   assuming that means 200 MegaBytes.  So I don't think that's
   the problem.  I don't have the hidden tag set in the page
   code so that shouldn't be a factor either, right? I'm a real
   rooky at php programming.
   -Original Message-
  
   INPUT TYPE=hidden name=MAX_FILE_SIZE value=2048000

 You actually _need_ that hidden tag set AFAIK.

I'm curious, I keep seeing people say that that tag is /necessary/, but I've 
never had to use it in the upload forms that I've built and they work just 
fine in Opera, NN  IE. 

Can anyone explain /why/ it's needed? 

AFAICT from the manual that tag is only to advise the browser to limit the 
size of the file being uploaded, nothing to suggest that the absence of the 
tag would prevent uploading. But if that was indeed the case then what 
browsers does it affect?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The value of a program is proportional to the weight of its output.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] file upload problem

2001-10-18 Thread SafeV

I've run into the same problem, I had to 'chmod 777 images' to be able 
to create dirs or files, which is BAD security!

Brian Aitken wrote:

 Hiya
 
 I promise I won't keep perstering you after this question :-)
 
 My problem is this - I've got a complete system that works perfectly on
 Linux but I've got to set it up on a new server that's running Windows.
 When I try to handle file uploads I get errors (when the same code worked
 perfectly under Linux).
 
 When I try to use mkdir like this:
 
 $name4loc = urlencode($mname);
 $loc = ./images/$name4loc;
 mkdir($loc,0777);
 
 I get the error:
 
 Warning: MkDir failed (Permission denied) in
 D:\Inetpub\wwwroot\HATII\admn\php\moss\mregdone.php on line 98
 
 When I try to copy a file like this:
 
 if (!copy ($test, $test_name))
 
 
   echo(Problem: Unable to copy image. brPlease try again.);
   exit;
  }
 
 I get the error:
 
 Warning: Unable to create 'vinlogo.jpg': Permission denied in
 D:\Inetpub\wwwroot\HATII\admn\php\a2paw\uptestdone.php on line 41
 
 I'm guessing PHP is somehow lacking permission to write to the file system
 but the technicians have tried changing the file permission for the
 directory I'm trying to write to and the same error is given.  We don't know
 what else to do.
 
 Any ideas?
 
 Thanks
 Brian
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] File Upload Problem

2001-09-03 Thread Johan Vikerskog (ECS)

Perhaps someone from your Network group(or similiar) have put a restriction towards 
that site for some strange reason. Ask your administrator and he probobly will know 
the answer.

//Johan

-Original Message-
From: Tim Grubb [mailto:[EMAIL PROTECTED]]
Sent: den 3 september 2001 09:55
To: [EMAIL PROTECTED]
Subject: [PHP] File Upload Problem


I have a problem uploading files that just started the other day. I have
been using the same script for 8 mos.

Site is hosted at a hosting facility.
Anyone outside of our company router can still upload fine.
From our office noone can upload. Only 8097 bytes get sent.
Regular access to the web has not been affected.
I can still do file uploads to Hotmail, Yahoomail etc... but they use a CGI.

The very odd thing is that if I go to a computer that has not yet uploaded a
file I can send one but then cannot send again. I have tried IE,Netscape and
used PC, Mac and Linux.


Any Ideas?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File Upload Problem Solving?

2001-09-01 Thread Marc Davenport

On Fri, 31 Aug 2001, Jeff Oien wrote:

 I have a user who is unable to upload files but I don't know where
 to start with the troubleshooting process. I have this:
 
 @copy($img1, /blah/$username/$img1_name) 
 or die(File upload didn't work.); 
 
 and they are getting the die message. All but one person are able
 to upload.
 Jeff Oien

Check the following things.
1. Permissions. The Directory of the particular user might be set
different and therefore be the reason for the upload.
2. Max File Size. I'm assuming that you are trying the same file for all
people, but if not then the one person that can upload might just be
uploading a smaller file than the rest. Just a thought.

You may want to use is_uploaded_file() and move_uploaded_file() if you are
using PHP 4.0.2 or greater.

hope this helps
cheers,
marc davenport
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] File Upload Problem Solving?

2001-08-31 Thread Jeff Oien

I found the problem. A user was logged in under their username
with a different case (capital/small letters) and that caused a problem.
Jeff Oien

 I have a user who is unable to upload files but I don't know where
 to start with the troubleshooting process. I have this:
 
 @copy($img1, /blah/$username/$img1_name) 
 or die(File upload didn't work.); 
 
 and they are getting the die message. All but one person are able
 to upload.
 Jeff Oien
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File upload problem on IIS/NT4

2001-02-20 Thread Phil Driscoll

Make sure that upload_tmp_dir in your php.ini file is set to something
sensible for a windows machine.
I have it set to f:\php\temp (and you also need to make sure that the
directory specified actually exists).

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File upload problem on IIS/NT4

2001-02-19 Thread John Vanderbeck

ITry searching the drive(s) for the file.  I dont know what the deal is, but
I found on my system that the session path specified in the php.ini file
isn't being used, it is using /tmp instead.  Might be doing the same thing
for the upload path.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: Josh G [EMAIL PROTECTED]
To: PHP User Group [EMAIL PROTECTED]
Sent: Monday, February 19, 2001 6:58 PM
Subject: [PHP] File upload problem on IIS/NT4


 Hi guys, I'm having a problem with file uploads, and I can't seem to
 fix it. I'm on IIS using php as an ISAPI module on NT4, and file uploads
 seem to work, but $userfile does not exist. Any ideas on how I can
 fix it?

 userfile:\\php8
 userfile_name:notes.txt

 Cheers,

 Gfunk -  http://www.gfunk007.com/

 I sense much beer in you. Beer leads to intoxication, intoxication to
 hangovers, and hangovers to... suffering.




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]