Re: Renaming a file uploaded by a form.

From: Date: Sat, 04 Jan 2003 17:36:19 +0000
Subject: Re: Renaming a file uploaded by a form.
Groups: php.db 
Request: Send a blank email to php-db+get-24548@lists.php.net to get a copy of this message
did you compile PHP with --enable-mime-magic? if not, this extension will not work. there are work arounds. one is....a class that resides on phpclasses.org that will give you a mime based on the file extension. and i'm sure there are other ways.... hth jeff "Info@Best-IT" <info To: <Jeffrey_N_Dyke@keane.com>, <php-db@lists.php.net> cc: 01/04/2003 Subject: Re: [PHP-DB] Renaming a file uploaded by a form. 12:25 PM Thanks for all your help. I got the file OK and I figured out how to rename it and make it an attachment to an email. But one thing is not working for me. When I look for the mime type I get the following error: Fatal error: Call to undefined function: mime_content_type() When I call it to define a variable: $ftype = mime_content_type($file) Any suggestions or ideas on how to do this? Thanks again! Tim on 1/1/03 6:08 PM, Jeffrey_N_Dyke@Keane.com at Jeffrey_N_Dyke@Keane.com wrote: > > > copy($_FILES['userfile']['tmp_name'],"/real/path/to/$_FILES['userfile'] > ['name']"); > > what you really want is... > http://www.php.net/manual/en/features.file-upload.php > > hth > jeff > > > > "Info@Best-IT" > <info To: <php-db@lists.php.net> > cc: > 01/01/2003 Subject: [PHP-DB] Renaming a file > uploaded by a form. > 06:25 PM > > > > > > > I have a script that uploads form data to a MySQL server then emails the > form data to alert people that an upload occurred. > > I am having trouble getting the form to upload my file with the actual > filename. The filename seems to be created by the PHP machine (wild guess) > but it looks like this: > > /var/tmp//phptkYxkV > > Any ideas on how to get it to look like: filename.doc would be greatly > appreciated. > > /Tim > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#24548) next »