uploading images - having problems

I believe that you should be able to just substitute $_FILES for $HTTP_POST_FILES

http://nl2.php.net/manual/en/reserved.v … bles.files

Note: Introduced in 4.1.0. In earlier versions, use $HTTP_POST_FILES.

[…]

$HTTP_POST_FILES contains the same information, but is not a superglobal. (Note that $HTTP_POST_FILES and $_FILES are different variables and that PHP handles them as such)

So they’re substitutable to a degree.

[php]
copy($HTTP_POST_FILES[‘file’][‘tmp_name’],“images/”.$HTTP_POST_FILES[‘file’][‘name’]);
[/php]

Again, why are you using copy() when move_uploaded_file() is ‘the right tool for the right job’? move_uploaded_file() saves you the trouble of having to deal with the upload_tmp_dir at all.

As for this:

Personally, I have been EXTREMELY happy with my Linux box. It has been running like a ROCK for at least 5 years. (Dual Pentium III 933 Mhz, 2 GB RAM, 180 GB Raid 5, 1 hot spare, hot swappable). In fact that's what's running this software.

Although I have been “attacked” a couple of times, it’s far less than one would probably have been attacked with a windows.

That’s one nifty config. Can you be my sugar daddy? :lol:

Seriously, I’m running a web/fileserver on:
Celeron 800MHz
128MB RAM
15GB ATA (+ 250GB external USB)
Windows 2003 Server

It’s a Packard Hell PC from 1999 and every day I’m amazed it hasn’t blown out yet (we have bad experiences with Packard Hell).

I’m not using copy(), but this simple script was they only one I could get to work and it uses copy().

The script I posted before (the big one) shows that I have used move_uploaded_file.

Cheers

<form enctype="multipart/form-data" action="pf_script_with_get($SCRIPT_NAME); " method="POST">

What do you see on this line when you browse to the page and view the source there?

Thanks… It runs like a champ, all things considered.

Packard Hell… eh? I had one of them when I first came home from Germany (Military Service) in 1992. Packard Hell 486sx 20. It was a speed demon. (Of the day anyway). I actually still have the DOS manual (MS DOS 5.0) from that machine because it describes ALL the dos commands in detail. It’s actually the best DOS book I have ever had.

I bought it for about $2000.00 and sold it a year afterwards for about $1500.00 to purchase a Zeos 486 DX2 66 (later upgraded it to a DX4 100). It’s amazing how far we have progressed since then.

Since we seem to be running offtopic here, perhaps it’s a good idea to create a separate thread in General (or somewhere else) where we can discuss and compare computer configs?

Sponsor our Newsletter | Privacy Policy | Terms of Service