Jump to content

Deleting a file


jcstanley

Recommended Posts

Hi

I currently have a php script which allows a user to do the following:
A title
A description
Upload a picture.

The picture gets stored in a folder called /pictures

The mysql table has the following fields:
title
description
picture

The link to a picture gets stored in the picture field (eg. /pictures/image1.jpg)

This all works fine until it comes to deleting.  The delete query will delete the entry in the table, but obviously not the actual uploaded picture in the /pictures folder.  

Eventually the /pictures folder will get full of images that are no longer used.

Is there anyway these pictures can be deleted at the same time as the data in the database?

Thanks
Link to comment
https://forums.phpfreaks.com/topic/35786-deleting-a-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.