Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting files from a server

Status
Not open for further replies.

keepingbusy

Programmer
Apr 9, 2000
1,470
GB
Hi all

Firstly, apologies if this is the wrong forum but I would be grateful for some direction where to post it if it's not.

I am trying to find out if there is a way to delete certain files from a server via phpmyadmin or some other way.

Everyday, we upload some CSV files via phpmyadmin and also upload some related images to those CSV files that contain music data. The images are the covers for the titles and all the processing and conversion is done via a Visual Foxpro 9 custom application.

As the table changes everyday, some of the images are no longer required and if not deleted, will start filling up our space.

The images are named for example 315268243789.jpg (or could be .gif), which relates to a UPC number or barcode. The list is created from the same VF9 APP (The exported file format can be adapted to any type e.g. txt, csv, tab etc).

The scenario we are trying to achieve is to create the new list (no problem), then run a piece of code that will remove the "no longer required" images from the server.

If you need any further information, please let me know.

Sorry it was long winded guys, but I hope you understand what I mean.

Many thanks
KB

Windows XP
Visual FoxPro Version 6 & 9
 
No, MySQL (or phpMyAdmin) has no way to delete files (other than table files). I'd imagine the best way to do it would be to have a job run on the server every so often to check and delete those files.
 
Normally, you would write a little script to do the job. On Linux, Bash or Perl via cron would be perfect; on Windows there's cmd.exe and probably other scripting facilities, scheduled via (I think) the Task Scheduler.
 
As thie info is in a database, perhaps mark the records for deletion and use perl to first select the image names for deletion, on successful deletion, delete the records from the db.

as TG said, linux, cron and perl/bash.
M$ cmd.ex or vb, csharp etc, the world can be your oyster.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top