473,769 Members | 6,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to delete picture file on server using PHP?

4 New Member
Hi,
I want to upload pictures in mysql database using blob. I have code to check the extension and sizes. But to store in mysql i have to upload the picture on server first. But if i upload the picture, i have to delete it asoon as the picture is loaded in mysql else there will be alot of unwanted pictures. Pls help how do i delete pictures on server using PHP. Also if u have simple code to upload pictures in mysql...i would be delighted to have it.... :)

Thanks in advance...
-sam
Jun 17 '06 #1
1 4844
hsriat
1,654 Recognized Expert Top Contributor
Hi,
I want to upload pictures in mysql database using blob. I have code to check the extension and sizes. But to store in mysql i have to upload the picture on server first. But if i upload the picture, i have to delete it asoon as the picture is loaded in mysql else there will be alot of unwanted pictures. Pls help how do i delete pictures on server using PHP. Also if u have simple code to upload pictures in mysql...i would be delighted to have it.... :)

Thanks in advance...
-sam
While uploading, PHP saves the files temporarily which is deleted automatically after the scrips ends. But if you are first saving it with another name (which is not recommended), then you can delete them by unlink.
May 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2398
by: news.microsoft.com | last post by:
I need some help here guys.... i have been simply trying to delete a file from the webserver using asp.net using the following code. System.IO.File.Delete(FullPath); however the error message i get is the following The process cannot access the file "e:\inetpub\wwwroot\client_dev\brands\Product_images\1450.jpg" because it is
5
1502
by: JoskeXP | last post by:
Hi, When I use the following code I have a error that the file is in use If File.Exists("c:\RegistratieMD\images\" + Me.txtBarcode.Text + ".jpg") = True Then File.Delete("c:\RegistratieMD\images\" + Me.txtBarcode.Text+ ".jpg") End If How can I solve this problem
1
1714
by: apple | last post by:
i try to print image file in a directory using PrintDocument. It will raise printPage event to draw image to the printer. The file will be deleted after print and the directory will be checked every second to get new file inside it. Where should i do the delete function? The way to print image is get from msdn. Can tell me where can i refer to other better ways to print the image file. Thank you. Public fileName As String
13
3277
by: Jim Carlock | last post by:
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I created an array already, and whereby, the HTML and Javascript currently used amount to about 14KB for each of four different pages, the PHP page I started working on is already over 35KB in size (most of it is server side processing creating the array...
5
8680
by: Tom Scales | last post by:
I am having a problem with an application I am writing in vb.net 2003. I display an image (JPG) on the screen using a Picturebox, loading it with image.fromfile. The user can select a key to delete the image. If I try to delete it, it throws an error that the file is in use. I tried the image.dispose() method, which allows me to copy the file and
6
8124
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a picture of themselves to their profile... I admit that I'm a newbie... but this is how I understand this:
1
2702
by: ApexData | last post by:
I have an ImageBox with PictureType set to LINK. I have a string with a path strPicFolderPath = "C:\Pictures" In the OnCurrent event of the form I have this code: If Len(Nz(Me.txtPHOTOFILENAME.Value, "")) <0 Then 'File name exists If Len(Dir$(strPicFolderPath + Me!)) <0 Then 'File found Me!.Picture = strPicFolderPath +
3
1890
by: davidson1 | last post by:
Posted Date :- 17 feb 2008 Hello to everybody, I am very thankful to "the scripts" contributors. Their answers are really useful to me. Now i have a Question I am storing a image in webserver normally in c:\inetpub\wwwroot\picture folder
4
5595
by: gerardianlewis | last post by:
Any help appreciated. (VB.NET under XP and Vista, SP1 installed) My code, inherited from a VB6 version of an app that ran under W98, loads an image from a file into a PictureBox. The user may want to move or delete the file that is being shown. The corresponding event- driven code for "delete this picture" uses: My.Computer.FileSystem.DeleteFile(sPath)
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.