CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> Programming

 delete a file while deleting a record- php and mysql

Print topic Send  topic

Author Message
Sarah
Posted: 09/19/2004, 9:25 PM

I have use an upload utility to upload images to a file on the server. What is the code to delete a am image from a file when that record is deleted from the database?
TAI!
Sarah
Sarah
Posted: 09/19/2004, 9:31 PM

I forgot to mention that I use an image called spacer.gif as a stand in if the record doesn't contain an image that I wouldn't want deleted.
Nicole

Posts: 586
Posted: 09/24/2004, 1:58 AM

Sarah,
I suppose that you’re using CodeCharge. If you have a gotocode project in CC format you can get a sample code from there. Page name is Uploader.
In common the code could be:
  
if( get_param("action") == "delete" )  
{  
  unlink("path_to_file and file_name");  
}  

_________________
Regards,
Nicole
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.