faqts : Computers : Programming : Languages : PHP : Common Problems : File Uploading

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 22 people (55%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

Is there a way to write the filename & path (image) to a database when uploading.

Feb 25th, 2002 18:50
Narendra Jain, Tim Neuman,


Once you are connected to the other server, various commands like  
ftp_rawlist, ftp_nlist, ftp_size let you have the various file names in 
the directory, their sizes, etc.
You could then store them in the database.
The sample commands could look like:
$f1= ftp_connect("ftp.ftpservername.com");
ftp_login("$f1","anonymous","myemail@mycomputer.com");
$filelist = $ftp_rawlist("$f1",ftp_pwd("$f1"));
$filecnt=sizeof($filelist);
for ($1=0; $i<$j, $i++) {
   $filename=next($filelist);
// Now store this $filename in the database
}
ftp_quit;
Hope this helps...
Narendra Jain