I wouldnt worry about filenames :) just make your own file name, store that
name with cross reference to the real filename in a db.

I allow users to update images to our server, I store them directly in the
db, I also store the mime-type along with the filename. every file has a
unique file_id number, I set this with the time functiuon, spec microtime().

<?php

 include_once('database.egn');
 include_once('time.egn');

 if (isset($db_file))
 {
  echo "INSERTING <br>\n";
   $db_file = urlencode(fread(fopen($db_file, 'r'), filesize($db_file)));
   $db_file_id = mtime();
  insert_db_value('images', " '$db_file_id', '$db_file', '$db_file_name',
'$db_file_type' ");
 }

 echo "
 <html>
 <body>

  <form method=post enctype='multipart/form-data' action='$PHP_SELF'>
 <input type=file name=db_file>
 <input type=submit>
 </form>

 </body>
 </html>
 ";

?>

something like this is real simple and works. might not be what your looking
for but could be easily modified.


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120



""Ashley M. Kirchner"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>     Before I embark on this little project, or just hunt for one already
> written (anyone have suggestions?), when creating an Upload script, how
> does one go about files coming from different platforms?
>
>     We have a unix FTP server and we'd like to make an Upload function
> on our website, where people can fill in a form with their information,
> select their (local) file to be uploaded and submit it.  However, I'm
> somewhat at a loss when it comes to things like:
>
>     - how to handle files with spaces in them?
>     - how to handle files created on a Mac platform, that include
>       characters like / , or a Mac-dot (OPTION-8), stuff that wouldn't
>       normally be allowed in a PC formatted file name
>     - how to handle Mac font files.  Whenever we have clients email us
>       individual fonts, it never comes through because of the font
>       control file.  We always get a 0 byte file.  (might this be
>       because our mail server is also unix, and mac files are 7-bit,
>       versus PC/Unix being 8-bit?)
>
>     I'm sure there are other issues to cope with, but these are the
> immediate ones I can think off.  Does anyone have a relatively robust
> Upload function written, or one you'd recommend using?
>
>     AMK4
>
> --
> W |
>   |  I haven't lost my mind; it's backed up on tape somewhere.
>   |____________________________________________________________________
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   SysAdmin / Websmith                           .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.             .        eFax 248.671.0909
>   http://www.pcraft.com                  .         3550 Arapahoe Ave #6
>   .................. .  .  .     .               Boulder, CO 80303, USA
>
>
>
> --
> 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]
>



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

Reply via email to