Jump to content

Recommended Posts

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!

 

Link to comment
https://forums.phpfreaks.com/topic/141122-date-created-file-deletion/
Share on other sites

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

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!

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']);

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.