Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM php uploader...help!

date posted 1st July 2002 15:30

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



Messages by Day
July 31st 2002
July 30th 2002
July 29th 2002
July 28th 2002
July 27th 2002
July 26th 2002
July 25th 2002
July 24th 2002
July 23rd 2002
July 22nd 2002
July 21st 2002
July 20th 2002
July 19th 2002
July 18th 2002
July 17th 2002
July 16th 2002
July 15th 2002
July 14th 2002
July 13th 2002
July 12th 2002
July 11th 2002
July 10th 2002
July 9th 2002
July 8th 2002
July 7th 2002
July 6th 2002
July 5th 2002
July 4th 2002
July 3rd 2002
July 2nd 2002
July 1st 2002


Messages by Month
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000