>But I can't fetch the extension, since php copies the file to
c:\windows\temp and calles the file something like phpdfdfe.tmp --> I cant
get the extension right (i'm writing it to a db) and the copy() outputs
permission denied!
If your filename variable is $foo, then $foo_name will have the original
name in it. $foo_type will have the mime type. $foo_size will tell you the
size of the file.
I'm not sure why you are using copy() if you are trying to write the file
into a database, but permission denied is a whole 'nother problem.
PHP runs as a specific user, that doesn't have full access to your server.
This is good. Otherwise, you'd have major security hole. So whatever user
PHP runs as, must have permission to write into the directory where you are
trying to copy the file.
If you are using Windows NT/2K, you can right-click on the directory where
you are trying to copy the file to, and you can dink around with enough
dialogs and buttons and lists and suchlike to add "iUSR_machinename" to the
list of users who can write to that directory. Note that the "machinename"
part is something you have to figure out from your IIS MMC or Apache
httpd.conf file -- It's the user PHP runs as...
If you are using Win95/Win98, I have no idea how to alter permissions on a
directory -- As near as I can figure, MS left that feature out... Let me
know if you find out differently.
If you are using WinME, I'm guessing it's more like NT/2K, but I've never
actually seen it, so I dunno.
There's also a cool GetImageSize() function in PHP that, even if $foo_name
and $foo_type were not there, you could probably use to find out what kind
of image you got, as well as its height and width.
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
--
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]