how to delete files using URI

#1
[eluser]xpix[/eluser]
Hi,

I am coding an image manager and I have problems deleting the files.

Under each image I have a Delete link to base_url() + upload/delete/myimage.jpg/files/64

upload - main controller
delete - a function inside the controller
the rest are just parameters for the delete function

The problem is that apache tries to get the image because of the extension and returns not found

My only solution for now is to have another parameter for the extension.
Eg: upload/delete/myimage/jpg/files/64

Is there another solution to this problem?


What happens if the file you upload has another . in the name. Looks complicated. Maybe is better to use query strings.

Thx


Edit: Maybe a hidden form field will do the trick. But it seems strange to have a form for each image. 50 images = 50 forms

#2
[eluser]jcopling[/eluser]
I will offer the experience that I have noticed CI turning "." in my URL into "_" so you may want to try just sending the URL in that format, i.e. base_url() + upload/delete/myimage_jpg/files/64 .

You certainly have a few options here. You could do any of the solutions you suggested. You could also use your .htaccess file to keep Apache from processing the image URL.

Personnaly, I would play around with replacing the "." in the URL with another character and see what you get.

#3
[eluser]xpix[/eluser]
I managed to do it by using a form, some hidden fields. On click I change the values of the hidden fields and submit the form.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.