Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

deleteing file form server PHP

Featured Replies

Hi,

 

I am having trouble using PHP to delete a file on my server. I have used the move_uploaded_file(); function to upload an image to a folder. I now need for people to be able to delete the image.

 

I have read that the unlink(); function should do the job but I cannot work out how?

 

Anybody know?

 

Cheers Rich.

  • Author

I think WDF can be bad for me, at every hurdle I immediately jump the gun and come to the forum for advice, before I thoroughly research the issue myself!

 

Well, I've managed to sort it now cheers!

Lol yup, I'm guilty of that one.

 

One thing that is useful though, if you do jump the gun or solve your own problem, share the solution anyway, if you wouldn't mind?

 

It means that anyone looking for the answer who stumbles across this thread won't be disappointed ;)

 

Just a suggestion :)

  • Author

Yes, sorry I normally do write the solution!

 

Your right Mihai, it was an issue with the file path, or at least how I built the file path using various variables (I guess that's about all that can go wrong!)

 

for those that don't know how the unlink(); function works it's pretty straight forward:

 

$file_path = 'directory/filename';
unlink($file_path);

 

This will delete whichever file the $file_path points to.

 

lol looking at that it couldn't be easier!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.