Re: [PHP] Re: File Upload Problem

2011-04-11 Thread Louis Huppenbauer
Is there already a file with the same name?
Apparently copy won't overwrite a file on windows if it already exists.

Maybe you have the same problem ffproberen2 at dodgeit dot com had on
the php.net/move_uploaded_file manpage?

2011/4/10 tedd tedd.sperl...@gmail.com:
 At 7:15 AM +0200 4/7/11, Wojciech Kupiec wrote:

 On 06/04/11 19:10, tedd wrote:

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

 If you really want to get help, publish your code.

 I don't think that's true. I should be able to ask a technical question with
 observations and inquire as to What's wrong? After all, what's the point
 of showing code that works on two servers, but fails on a third? Really,
 what is that going to tell you?

 As for the uploaded file exceeding max file size and file_uploads
 enabled, those are obvious and I did that investigation before I posted the
 question. They are NOT the problem.

 I also checked all the servers involved for safe_mode and open_basedir
 settings and they are set the same. Additionally, the upload_max_filesize
 and upload_tmp_dir are also set exactly the same. As such, I don't know
 what else to look for -- hence my question.

 As I said, the script works on two servers, but fails on a third.

 This is what I've learned in addition to the above:

 The script does successfully upload the file to the server in question. For
 example, I receive truth from:

 if(is_uploaded_file($_FILES['userfile']['tmp_name']))
   {
   echo('true');
   }

 I can even get the contents of the uploaded file by:

 $contents = file_get_contents($_FILES['userfile']['tmp_name']);
 echo($contents);

 -- and the contents are displayed.

 So, the file is indeed uploaded!

 What I cannot do is move the file to another location using:

 $result = move_uploaded_file($_FILES['userfile']['tmp_name'], $path . '/' .
 $_FILES['userfile']['name']);

 (Yes, all possible file paths have been investigated)

 Nor, can I copy the file by:

 $result = copy($_FILES['userfile']['tmp_name'], $path . '/' .
 $_FILES['userfile']['name']);

 The only difference I see is the server causing problems is Windows NT
 whereas the others are Linux.

 So, knowing this  -- does anyone have any idea as to what is wrong?

 Cheers,

 tedd

 --
 ---
 http://sperling.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] Re: File Upload Problem

2011-04-11 Thread Hans Åhlin
I had some similar problem with Windows 7,
it had to do with UAC and folder rights. Apache/PHP could read but not
write to any dir except the ones that all users could write to.
I solved it by allowing every one to read, write and change content in
the directory where I needed PHP to handle/control the content.


2011/4/10 tedd tedd.sperl...@gmail.com:
 At 7:15 AM +0200 4/7/11, Wojciech Kupiec wrote:

 On 06/04/11 19:10, tedd wrote:

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

 If you really want to get help, publish your code.

 I don't think that's true. I should be able to ask a technical question with
 observations and inquire as to What's wrong? After all, what's the point
 of showing code that works on two servers, but fails on a third? Really,
 what is that going to tell you?

 As for the uploaded file exceeding max file size and file_uploads
 enabled, those are obvious and I did that investigation before I posted the
 question. They are NOT the problem.

 I also checked all the servers involved for safe_mode and open_basedir
 settings and they are set the same. Additionally, the upload_max_filesize
 and upload_tmp_dir are also set exactly the same. As such, I don't know
 what else to look for -- hence my question.

 As I said, the script works on two servers, but fails on a third.

 This is what I've learned in addition to the above:

 The script does successfully upload the file to the server in question. For
 example, I receive truth from:

 if(is_uploaded_file($_FILES['userfile']['tmp_name']))
   {
   echo('true');
   }

 I can even get the contents of the uploaded file by:

 $contents = file_get_contents($_FILES['userfile']['tmp_name']);
 echo($contents);

 -- and the contents are displayed.

 So, the file is indeed uploaded!

 What I cannot do is move the file to another location using:

 $result = move_uploaded_file($_FILES['userfile']['tmp_name'], $path . '/' .
 $_FILES['userfile']['name']);

 (Yes, all possible file paths have been investigated)

 Nor, can I copy the file by:

 $result = copy($_FILES['userfile']['tmp_name'], $path . '/' .
 $_FILES['userfile']['name']);

 The only difference I see is the server causing problems is Windows NT
 whereas the others are Linux.

 So, knowing this  -- does anyone have any idea as to what is wrong?

 Cheers,

 tedd

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

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





-- 


**
 Hans Åhlin
   Tel: +46761488019
   icq: 275232967
   http://www.kronan-net.com/
   irc://irc.freenode.net:6667 - TheCoin
**

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



Re: [PHP] Re: File Upload Problem

2011-04-11 Thread tedd

At 7:37 AM +0100 4/11/11, Ashley Sheridan wrote:

tedd tedd.sperl...@gmail.com wrote:

 So, knowing this  -- does anyone have any idea as to what is wrong?

What happens if you diff the various config files involved directly, 
php.ini, https.conf, any other site-specific *.conf files used by 
apache. Sometimes its a security feature in a .conf file that 
means I can override a setting myself in code or in an .htaccess 
file. Takes ages to find and annoying to debug around!


Ash


Ash:

I think that's the problem. I just wanted to bounce this experience 
off the group before making a fool of myself by asking for help at 
the local college where I'm trying to get the script to run. I think 
they have some security protocol in place to prevent this.


Thanks,

tedd

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

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



Re: [PHP] Re: File Upload Problem [SOLVED]

2011-04-11 Thread tedd

At 10:07 AM -0400 4/11/11, tedd wrote:

At 7:37 AM +0100 4/11/11, Ashley Sheridan wrote:

tedd tedd.sperl...@gmail.com wrote:

 So, knowing this  -- does anyone have any idea as to what is wrong?

What happens if you diff the various config files involved 
directly, php.ini, https.conf, any other site-specific *.conf files 
used by apache. Sometimes its a security feature in a .conf file 
that means I can override a setting myself in code or in an 
.htaccess file. Takes ages to find and annoying to debug around!


Ash


Ash:

I think that's the problem. I just wanted to bounce this experience 
off the group before making a fool of myself by asking for help at 
the local college where I'm trying to get the script to run. I think 
they have some security protocol in place to prevent this.


Thanks,

tedd


To all:

That was the problem.

The school had banned the practice of uploading any files to their 
server. I got permission for my class, but it is under a strict need 
to know basis.


Thanks for listening.

Cheers,

tedd

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

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



[PHP] Re: File Upload Problem

2011-04-10 Thread tedd

At 7:15 AM +0200 4/7/11, Wojciech Kupiec wrote:

On 06/04/11 19:10, tedd wrote:

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


If you really want to get help, publish your code.


I don't think that's true. I should be able to ask a technical 
question with observations and inquire as to What's wrong? After 
all, what's the point of showing code that works on two servers, but 
fails on a third? Really, what is that going to tell you?


As for the uploaded file exceeding max file size and file_uploads 
enabled, those are obvious and I did that investigation before I 
posted the question. They are NOT the problem.


I also checked all the servers involved for safe_mode and 
open_basedir settings and they are set the same. Additionally, the 
upload_max_filesize and upload_tmp_dir are also set exactly the 
same. As such, I don't know what else to look for -- hence my 
question.


As I said, the script works on two servers, but fails on a third.

This is what I've learned in addition to the above:

The script does successfully upload the file to the server in 
question. For example, I receive truth from:


if(is_uploaded_file($_FILES['userfile']['tmp_name']))
   {
   echo('true');
   }

I can even get the contents of the uploaded file by:

$contents = file_get_contents($_FILES['userfile']['tmp_name']);
echo($contents);

-- and the contents are displayed.

So, the file is indeed uploaded!

What I cannot do is move the file to another location using:

$result = move_uploaded_file($_FILES['userfile']['tmp_name'], $path . 
'/' . $_FILES['userfile']['name']);


(Yes, all possible file paths have been investigated)

Nor, can I copy the file by:

$result = copy($_FILES['userfile']['tmp_name'], $path . '/' . 
$_FILES['userfile']['name']);


The only difference I see is the server causing problems is Windows 
NT whereas the others are Linux.


So, knowing this  -- does anyone have any idea as to what is wrong?

Cheers,

tedd

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

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



[PHP] Re: File Upload Problem

2011-04-06 Thread Wojciech Kupiec

On 06/04/11 19:10, tedd 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?



The simplest explanation is that you don't have write permissions to the 
location where you upload the file or to the temp directory.


If you really want to get help, publish your code.


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



[PHP] Re: File Upload problem

2003-10-20 Thread pete M
It might be the script timing out - defaults to 20 seconds

check
set_time_limit()
regards
pete


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



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


Re: [PHP] Re: File Upload problem

2003-10-20 Thread Grant Rutherford
No, I'm afraid that the results are nearly instantaneous.  If it timed 
out, there should be a corresponding delay before I got the error message.

Thanks,
Grant
pete M wrote:

It might be the script timing out - defaults to 20 seconds

check
set_time_limit()
regards
pete


--
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


[PHP] Re: file upload problem

2003-08-23 Thread Catalin Trifu
Hi,

 echo form action = '. $_SERVER[PHP_SELF].' method = 'GET' enctype
 = 'multipart/form-data'\n;
I think that the methos should be POST not GET
Second, you may want to save the file first with,
move_uploaded_file (see
http://de.php.net/manual/en/function.move-uploaded-file.php),
then you will be able to see it.
Of course you will first check it's in order to save it.
Third: it might be a good idea to check your php.ini and
see if you allow file uploads and also the httpd.conf

cheers,
Catalin

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



[PHP] Re: File upload problem

2003-06-05 Thread Mi5ha
If you don't want users to write empty files to your server, why don't you
just stop them ? You can write something like this:

if ($HTTP_POST_FILES['file1']['size']!=0){
  move_uploaded_file($HTTP_POST_FILES['file1']['tmp_name'],
$upload_dir.$HTTP_POST_FILES['file1']['name']);
}
else {
  echo WARNING: File is zero size !!!br;
}

Mi5ha

--
Please enter your access password: penis
ERROR: Sorry your password is not long enough...



Sami Kollanus [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm using:
 - Apache 2.0.40 server (linux)
 - PHP 4.2.2

 I use file uploads in my code, but there occured small problems with the
 server update(from Apache 1.3.??, PHP 4.1.2). is_uploaded_file()- and
 move_uploaded_file()-functions don't work correctly any more. Or
 actually the file upload system doesn't work correctly.

 The problem is to recognice, when the user try to upload a file, which
 doesn't exist. It's possible to even write nonsense like sdafasdf into
 the file type input-field (Mozzilla and IE). In that case the current
 server writes an empty file named according to the text sdafasdf.

 When there is a legal empty file uploaded to the server,
 is_uploaded_file() doesn't fail. So, there is no way to recognice, when
 the user try upload a nonsense-file.

 Can anybody help? I don't know, if it's PHP or Apache causing the
 problem. Is there any settings, which could cause this?




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



[PHP] Re: File upload problem

2003-06-05 Thread Sami Kollanus
Thanks for the idea. I didn't think that solution before, bacause in the 
 previous PHP-version it was impossible to upload empty files. Now 
server makes empty file even, if there is no file to upload.

I still would like to know, where is the reason for the change of 
function in the server. Is there somebody, who knows?

If you don't want users to write empty files to your server, why don't you
just stop them ? You can write something like this:
if ($HTTP_POST_FILES['file1']['size']!=0){
  move_uploaded_file($HTTP_POST_FILES['file1']['tmp_name'],
$upload_dir.$HTTP_POST_FILES['file1']['name']);
}
else {
  echo WARNING: File is zero size !!!br;
}
Mi5ha

--
Please enter your access password: penis
ERROR: Sorry your password is not long enough...


Sami Kollanus [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm using:
- Apache 2.0.40 server (linux)
- PHP 4.2.2
I use file uploads in my code, but there occured small problems with the
server update(from Apache 1.3.??, PHP 4.1.2). is_uploaded_file()- and
move_uploaded_file()-functions don't work correctly any more. Or
actually the file upload system doesn't work correctly.
The problem is to recognice, when the user try to upload a file, which
doesn't exist. It's possible to even write nonsense like sdafasdf into
the file type input-field (Mozzilla and IE). In that case the current
server writes an empty file named according to the text sdafasdf.
When there is a legal empty file uploaded to the server,
is_uploaded_file() doesn't fail. So, there is no way to recognice, when
the user try upload a nonsense-file.
Can anybody help? I don't know, if it's PHP or Apache causing the
problem. Is there any settings, which could cause this?


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


[PHP] Re: File upload problem

2003-01-23 Thread Neil M
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.



try a double \\ in windows paths



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


you will need to put a form action url in above line , like 
action=http://www.domain-name.com/script.php;

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




Thanks

Neil


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




[PHP] Re: File upload problem

2003-01-21 Thread Bobby Patel
Since you have 'safe-mode' on, Register globals will be turned off, so you
should test $HTTP_POST_VARS['Submit'], instead.
John M [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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




RE: [PHP] Re: File Upload Problem

2002-10-31 Thread David Robley
In article 01c2805a$8a2a11a0$4b0a0a0a@skink, 
[EMAIL PROTECTED] says...
 
 G'day David
 
My problem is that files uploaded through a form are 
increasing in size.
 
   Doesn't that look like the EOL characters are being 
   translated after the fashion of ftp ascii transfers?
 
   Maybe have a look at the two versions in a 
   hex viewer and see if that is the case? 
 
 Yes, I'd considered that.  That was what I'd gone looking for in config
 files etc.  I'd hoped to find a switch for ftp transfer mode.  Didn't
 find one though.
 
 However, partly because of your email and partly because I noted that
 the file size increase was the same every time (27 bytes) I decided to
 load it into a hex editor.
 
 What I found was that at the top of the file, the following had been
 added:
 
 -8-
 Content-Type: image/gif
 
 -8-
 
 I also found that if I remove these two lines the image will display
 perfectly.
 
 So, my next question is, why does my linux box add this to an uploaded
 image and my windows box not do so?  Can someone make a suggestion on
 where I should be looking?  Is the addition of this information a server
 (Apache) thing?  Or is it a php thing?
 
 CYA, Dave

That's, er, odd?? Dunno whether you might find anything useful from 

http://www.google.com/search?q=upload+file+content+type+form+multipart+ima
ge+phpsourceid=operanum=0ie=utf-8oe=utf-8

(unwrap that). As I understand it, upload by form has nothing to do with 
ftp - it's part of http - and I assume that it is intended to do an 
'exact' copy? Perhaps a code snippet, just in case anyone can pick 
something odd about it.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




RE: [PHP] Re: File Upload Problem

2002-10-31 Thread Richard Archer
I've had 2 thoughts on this one. They're fairly uneducated an just
meandering speculation, but it's my tuppence-worth so...

My initial thought was this: I believe the Content-Type: MIME header is
added by your browser. HTTP standards say that anything sending a file
over HTTP is supposed to tell the recipient what type of file it's
sending. It does this by adding the Content-Type: header at the start of
the stream. Normally, PHP will read this header and put it in the
$_FILES['userfile']['type'] variable. Perhaps your Linux browser adds
the header in such a way that PHP cannot extract it properly, and simply
thinks it's part of the file? You could try checking the
$_FILES['userfile']['type'] variable to see if it contains the correct
MIME type.

It then dawned on me that I know either Apache or PHP (can't remember
which, possibly both, but most likely Apache) can so some clever stuff
where it fills in missing MIME type headers by analysing the file being
transferred. It's possible that your Linux browser is not sending a
Content-Type: header and so Apache tries to fill one in and it's APACHE
that is adding the iffy header that PHP doesn't recognise.
Alternatively, it's possible that your browser IS adding the header, but
Apache doesn't recognise it, so adds another one. PHP happily extracts
the first one, but doesn't spot the second one so it creeps through.

Of course, all that could be wrong as I'm not an expert on file uploads,
but it might be a place to start looking.

Regards,
Rich


-Original Message-
From: David Freeman [mailto:dfreeman;outbackqld.net.au] 
Sent: 30 October 2002 9:23 pm
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: File Upload Problem



G'day David

   My problem is that files uploaded through a form are 
   increasing in size.

  Doesn't that look like the EOL characters are being 
  translated after the fashion of ftp ascii transfers?

  Maybe have a look at the two versions in a 
  hex viewer and see if that is the case? 

Yes, I'd considered that.  That was what I'd gone looking for in config
files etc.  I'd hoped to find a switch for ftp transfer mode.  Didn't
find one though.

However, partly because of your email and partly because I noted that
the file size increase was the same every time (27 bytes) I decided to
load it into a hex editor.

What I found was that at the top of the file, the following had been
added:

-8-
Content-Type: image/gif

-8-

I also found that if I remove these two lines the image will display
perfectly.

So, my next question is, why does my linux box add this to an uploaded
image and my windows box not do so?  Can someone make a suggestion on
where I should be looking?  Is the addition of this information a server
(Apache) thing?  Or is it a php thing?

CYA, Dave





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




[PHP] Re: File Upload Problem

2002-10-30 Thread David Robley
In article 002e01c27f99$20e35b50$030a0a0a@skink, 
[EMAIL PROTECTED] says...
 Hi All
 
 I'll start by saying that I've checked the online manual (and comments)
 as well as having done a Google search on this with no success.
 
 My problem is that files uploaded through a form are increasing in size.
 For example, I upload an image that is 7658 bytes and the uploaded
 version is 7685 bytes, or upload 11106 bytes and it's 11133 bytes when
 uploaded.  Images uploaded through my form are broken in the process and
 no longer display.
 
 This is only happening on my production server (RH Linux-based).  My
 development environment is Win XP with Apache and PHP and the exact same
 code works perfectly.
 
 I've checked through /etc/php.ini for anything related without success.
 I use move_uploaded_file() to handle the uploaded file once it's on the
 server.
 
 Can anyone suggest where else I should be looking to resolve this?
 
 Thanks,
 Dave

Doesn't that look like the EOL characters are being translated after the 
fashion of ftp ascii transfers? Maybe have a look at the two versions in a 
hex viewer and see if that is the case? 

Not a solution, but maybe a further step in the debugging process?

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




RE: [PHP] Re: File Upload Problem

2002-10-30 Thread David Freeman

G'day David

   My problem is that files uploaded through a form are 
   increasing in size.

  Doesn't that look like the EOL characters are being 
  translated after the fashion of ftp ascii transfers?

  Maybe have a look at the two versions in a 
  hex viewer and see if that is the case? 

Yes, I'd considered that.  That was what I'd gone looking for in config
files etc.  I'd hoped to find a switch for ftp transfer mode.  Didn't
find one though.

However, partly because of your email and partly because I noted that
the file size increase was the same every time (27 bytes) I decided to
load it into a hex editor.

What I found was that at the top of the file, the following had been
added:

-8-
Content-Type: image/gif

-8-

I also found that if I remove these two lines the image will display
perfectly.

So, my next question is, why does my linux box add this to an uploaded
image and my windows box not do so?  Can someone make a suggestion on
where I should be looking?  Is the addition of this information a server
(Apache) thing?  Or is it a php thing?

CYA, Dave




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




[PHP] Re: file upload problem

2002-09-05 Thread nicos

Take a look at
http://www.php.net/manual/sv/printwn/features.file-upload.php, your pages
should be named .php and not .php3 if you support PHP4.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

Ram K [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 Hey

 I have a prob with my php file upload. i am using windows

 my html file looks like
 
 HTML
 HEAD/HEAD
 BODY
 FORM ACTION=upload1.php3 METHOD=post
 ENCTYPE=multipart/form-data
 Upload the datafile here
 INPUT TYPE=file NAME=file
 brbr
 INPUT TYPE=submit NAME=Submit VALUE=Submit Form
 /FORM
 /BODY
 /HTML
 
 my php file looks like
 
 ?
 $endresult = File Was Uploaded;

 $newfile = C:\\upload\\.$file_name;

 echo $newfile.br;
 echo $file.br;

 @copy($file, $newfile) or $endresult = Couldn't Copy File To
 Server;

 echo $endresult;
 ?

 
 when i run i get an error
 \\php2
 c:\upload\a.gif
 cannot upload file

 any ideas why?? also i am not clear as to where the \\php2 comes
  from

 thanks in advance

 regards
 ram

 __
 Give your Company an email address like
 ravi @ ravi-exports.com.  Sign up for Rediffmail Pro today!
 Know more. http://www.rediffmailpro.com/signup/




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




[PHP] Re: file upload problem (files 7.5mb)

2002-03-05 Thread Peter Clarke

Stefan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
 i wrote a php uploadscript and it works fine till the file is not larger
 then 7.5mb.
 is set the max upload file size in the upladfrom as well as in php.ini to
 100mb. but it still doesn't work!
 system is linux red hat and php 4.0.6 (with mysql)
 is there anyone who had the samestefa problem and knows a solution?

 stefan


I suspect the killer is 'post_max_size'
Adjust settings for:

max_execution_time
memory_limit
post_max_size

Also you really should upgrade to php 4.1.2 since this fixes a security hole
in file uploads.

Peter


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




[PHP] Re: file upload problem (files 7.5mb)

2002-03-04 Thread Joe Van Meer

Hi there:) Are you using the hidden form field with the max file limit set?

Cheers, Joe :)


Stefan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
 i wrote a php uploadscript and it works fine till the file is not larger
 then 7.5mb.
 is set the max upload file size in the upladfrom as well as in php.ini to
 100mb. but it still doesn't work!
 system is linux red hat and php 4.0.6 (with mysql)
 is there anyone who had the samestefa problem and knows a solution?

 stefan





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




[PHP] Re: file upload problem - Warning: Max file size of 8 bytes exceeded

2001-12-15 Thread David Serrano

I'm not sure if you've read this or not but it may help:
http://www.php.net/manual/en/features.file-upload.php

-David Serrano ([EMAIL PROTECTED])

Lee Philip Reilly [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I have an HTML form containing a file upload form object called 'file'.
 When I submit the form (either holiding a path to a 1kb file or a 7MB
 file) I get the following error:

 -
 Warning: Max file size of 8 bytes exceeded - file [file] not saved in
 Unknown on line 0
 -

 I had hoped that by changing the upload_max_filesize value in the
 php.ini this problem would be resolved, but it hasn't. I expect some
 people have had similar problems in the past; can anyone suggest what
 the problem is? Some additional info at the foot of this message.

 Thanks in advance!

 - Best regards,

 Lee

 Windows 2000; PHP4; Apache V1.3

 PHP.INI reads:
 -=-=-==-=-=-=-=
 ; Maximum allowed size for uploaded files.
 upload_max_filesize = 8M
 -=-=-==-=-=-=-=

 Simplified PHP script reads:
 -=-=-==-=-=-=-=
 if ($file!=){
  @copy($file, c:\Program Files\Apache Group\Apache\htdocs\sasdap\v4
 or die (Could not copy the file.);
 }
 else {
  die(No input file specified);
 }
 -=-=-==-=-=-=-=

 .HTML's file upload name = file




-- 
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]