⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Image delete (or unlink) problem



jberculo

jberculo
  • profile picture
  • Member

Posted 26 September 2012 - 13:32 PM

I have an image upload on a model: $crud->set_field_upload('image_landing','../data/uploads/images');

Uploading is fine, but when I try to remove the file, the ajax call gives a 400 bad request error: The URI you submitted has disallowed characters.

The url that is invoked is the following:

http://domain/admin/crud/configurations/delete_file/background_image_landing/7a16f-logo.jpg?_=1348664745109

It seems to hava a problem with the part from and including the ?.

Anyone an idea to fix this (without allowing ALL characters in permitted_uri_chars.

victor

victor
  • profile picture
  • Member

Posted 26 September 2012 - 20:38 PM

HI! show the value $config['permitted_uri_chars']

mephi

mephi
  • profile picture
  • Member

Posted 22 January 2013 - 15:46 PM

Hello,
DId you solved the problem???

I'm having the same issue on the following link from firebug:
"NetworkError: 404 Not Found - http://MYDOMAIN.com/...=1358869199998"

Where image1 is column that stores image url.
The return from the above url is hovever:
{"success":true}

My permitted chars settings from config are:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

Please help out.

P.S. I'm using HMVC if that helps.
P.S.2. Image is being deleted from both db and uploads folder.

mephi

mephi
  • profile picture
  • Member

Posted 23 January 2013 - 06:17 AM

Attached is the image with what is happening in the interface (delete image ajax loader hanging up), resplonse from server (success) and the params sent (frist tab from firebug)

What can be the issue? :|

I have no errors on my server error.log from root section, and I don't know where/how to debug more.

mephi

mephi
  • profile picture
  • Member

Posted 23 January 2013 - 08:48 AM

Hey guys, it turns out that I fixed the issue.

For anyone who is having this kind of issue take a look at your root .htaccess file.

This is my current .htaccess file which is working right:


## Set up mod_rewrite
<IfModule mod_rewrite.c>
Options +FollowSymLinks -Indexes
# disable the Apache MultiViews directive if it is enabled on the server. It plays havoc with URL rewriting
Options -MultiViews
RewriteEngine on

# Keep people out of codeigniter directory and Git/Mercurial data
RedirectMatch 403 ^/(system\/cms\/cache|system\/codeigniter|\.git|\.hg).*$

# Send request via index.php (again, not if its a real file or folder)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
</IfModule>

It's taken from pyrocms file since I haven't found a default CodeIgniter .htaccess anywhere ... Default CI .zip package is coming without one.

goFrendiAsgard

goFrendiAsgard
  • profile picture
  • Member

Posted 27 January 2013 - 05:56 AM

I think you miss the "rewrite base" part
Here is mine:

<IfModule mod_rewrite.c>
Options +FollowSymLinks -Indexes
RewriteEngine On
RewriteBase /~gofrendi/module-devel/
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

The CodeIgniter application is accessed by using this url: "http://localhost/~gofrendi/module-devel/"
So, adjust it with yours