pwnuspoints Posted January 16, 2009 Share Posted January 16, 2009 Hello there phpfreaks! Any help with my topic would be greatly appriciated! Thanks in advance! My issue(s): I am using php/mysql to upload files to my server. As it is, my php relocates the selected file to the server and stores information regarding the files in a database for web display. However, I'm finding the stored information limited and would like to store more than just the file names, and file sizes in the database. Is there any way to capture the "Date Created" information from files as I upload them. Simply logging the date and time the file was uploaded is irrelevant to my project. I need to know when the file was created for increased control in the web interface. The second concern regards the deletion of files from my server. I have noticed that when I use my web interface to delete a file, it only deletes the file from my database records. Is there any way to move the file to the recyclebin on my server or to a junk folder instead of letting useless files build up on my server? I apologize if my request for help is written in a sloppy manner, I'm writing this during a lunchbreak. Mmmtacos! Thanks again! Quote Link to comment Share on other sites More sharing options...
RussellReal Posted January 16, 2009 Share Posted January 16, 2009 no, your post is very detailed, *thumbs up*. unlink deletes files, when you click on whatever options you have in your interface, run unlink on the file and it should trash the file from the server.. date created idk about.. if you mean date created on the uploader's end.. idk if you could.. but! You could record the date UPLOADED with date Quote Link to comment Share on other sites More sharing options...
pwnuspoints Posted January 16, 2009 Author Share Posted January 16, 2009 Thanks for your help! Sadly I am already using unlink() to delete files from the server, yet they remain in the folder. It's rather frustrating. I'd imagine the best work around would be to re-tool my 'delete code', to relocate trashed files to a nearby 'junk folder'. capturing the 'date created' from the metadata of files is still an unresolved issue. I'm not even sure if it's possible, does anyone have ideas, or should I give up on that? Thanks again! Quote Link to comment Share on other sites More sharing options...
RussellReal Posted January 16, 2009 Share Posted January 16, 2009 don't give up on the dates thing, but settle for the upload time medium and, are you unlinking the correct path? e.g. in your database you have "filename" but that isn't the full path from where the script is being executed most likely.. it is probably in a folded like /db_files/ so you'd prepend all your filenames from the database which are to be deleted with "/db_files/" LIKE SO: unlink("/db_files/".$mysql_assoc_row['filename']); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.