|
|
 |
Re: FN-FORUM php uploader...help!
date posted 1st July 2002 17:06
Hi Rob,
My mistake - having a *very* slow Monday!
Try...
$HTTP_POST_FILES['photo']['tmp_name'];
Regards,
Steve
----- Original Message -----
From: "Rob Garbutt" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Monday, July 01, 2002 3:33 PM
Subject: Re: FN-FORUM php uploader...help!
thanbks for that!
quite interesting, but I've now got the copy funstion to work using the
following:-
copy($photo, "$dir/1.gif") or die("The file you are trying to upload
couldn't be copied to the server as it already exists click here to return to menu and try
again");
but when I use:-
copy($HTTP_POST_FILES['photo'], "$dir/1.gif") or die("The file
you are trying to upload couldn't be copied to the server as it already
exists click here to return to menu and try
again");
I get:-
Warning: Unable to open 'Array' for reading: No such file or directory in
/usr/blah/blah/blah
any ideas?
Robin Garbutt
Portfolio Art & Design Ltd
Tel - +44 (0) 1204 383822
Fax - +44 (0) 1204 383866
Mob - +44 (0) 7811 185490
e-mail - [EMAIL REMOVED]
For further information please visit us at :-
www.portfoliodesign.net
The contents of this e-mail are confidential to the ordinary user of the
e-mail address to which it was addressed and may also be privileged. If you
are not the addressee of this e-mail you may not copy, forward, disclose or
otherwise use it or any part of it in any form whatsoever. If you have
received this e-mail in error please e-mail the sender.
----- Original Message -----
From: "Steve Webster" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Monday, July 01, 2002 3:06 PM
Subject: Re: FN-FORUM php uploader...help!
> Hi Rob,
>
> You're nearly there, having correctly identified the problem, but you've
> made a small whoopsie in circumventing it. The reason $name is not
available
> is that the default php.ini file with v 4.2.0+ has register_globals set to
> 'off' - meaning that variables passed through GET or POST (as well as
> others) are no longer automatically created as global variables - and it
is
> this that's causing the error in your script.
>
> I think you realised that judging by your second attempt, but you've made
a
> mistake with the array notation. Instead of...
>
> copy ($HTTP_POST_FILES[$name], "$dir/1")
>
> ...it should be...
>
> copy ($HTTP_POST_FILES['name'], "$dir/1")
>
> Also, whether register_globals is turned on or not, you should always use
> the HTTP_POST_FILES associative array when deadling with uploaded files,
> especially when issuing system commands such as copy() based on the data
> received. This will ensure that the data you're working with came through
> the file upload system and not by any other means (i.e. standard GET and
> POST).
>
> I hope this helps!
>
> Regards,
>
> Steve
>
>
> ----- Original Message -----
> From: "Rob Garbutt" [EMAIL REMOVED]
> To: [EMAIL REMOVED]
> Sent: Monday, July 01, 2002 2:14 PM
> Subject: FN-FORUM php uploader...help!
>
>
> Hi All,
>
> has anyone any ideas about this?
>
> I've got a script that uploads images through the browser using the copy
> function in php. I've used it loads and it works fine on netnorth servers
> running php4.1.2
>
> I've recently installed php4.2.1 onto a unix server and its running with
its
> default php.ini file. The upload script no longer works,, it comes back
> with:-
>
> Warning: Unable to open '' for reading: No such file or directory in
> /usr/home/test/admin/test3/accomm/insert2.php on line 34
>
> (where the file is coming from a windows directory)
>
> the script is simply:-
>
> copy ($name, "$dir/1") or die(" background=../../../Images/background.gif text=#000000> face=Arial, Helvetica, sans-serif size=2>The file you are trying to upload
> couldn't be copied to the server as it already exists click href=index.php> here to return to menu and try
> again");
>
> I've tried using:-
>
> copy ($HTTP_POST_FILES[$name], "$dir/1") or die(" background=../../../Images/background.gif text=#000000> face=Arial, Helvetica, sans-serif size=2>The file you are trying to upload
> couldn't be copied to the server as it already exists click href=index.php> here to return to menu and try
> again");
>
> but just get the same.
>
> i'm proper pulling me hair out big style!
>
> can anyone shed some light on it? Have I overlooked something?
>
> thanks very much in advance!!!
>
> Robin Garbutt
> Portfolio Art & Design Ltd
> Tel - +44 (0) 1204 383822
> Fax - +44 (0) 1204 383866
> Mob - +44 (0) 7811 185490
> e-mail - [EMAIL REMOVED]
>
> For further information please visit us at :-
> www.portfoliodesign.net
>
> The contents of this e-mail are confidential to the ordinary user of the
> e-mail address to which it was addressed and may also be privileged. If
you
> are not the addressee of this e-mail you may not copy, forward, disclose
or
> otherwise use it or any part of it in any form whatsoever. If you have
> received this e-mail in error please e-mail the sender.
>
>
>
> ================================================================
> = ************************* SilkPHP ************************** =
> = ---------> Free PHP Scripts for your web sites = ******************* www.silkphp.com/?fl ******************** =
> ================================================================
>
> Sponsor the forum for as little as £1 at:
>
> http://www.freelancers.net/cgi/sponsor.cgi?action=show
>
>
> Freelancers and Freelance Jobs:
> http://www.freelancers.net
>
> Forum FAQs:
> http://freelancers.netrickery.com
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
>
>
> ================================================================
> = ************************* SilkPHP ************************** =
> = ---------> Free PHP Scripts for your web sites = ******************* www.silkphp.com/?fl ******************** =
> ================================================================
>
> Sponsor the forum for as little as £1 at:
>
> http://www.freelancers.net/cgi/sponsor.cgi?action=show
>
>
> Freelancers and Freelance Jobs:
> http://www.freelancers.net
>
> Forum FAQs:
> http://freelancers.netrickery.com
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
================================================================
= ************************* SilkPHP ************************** =
= ---------> Free PHP Scripts for your web sites |
 |
|