Can't delete entries with uploaded files

QuestionsCan't delete entries with uploaded files
Thomas asked 1 year ago

Hello,

today I hve the issue that I can’t delete entries with uploaded files. An alert box appears, but with no content, though “display errors” activated.

Happens with pure demo file “File Upload”.

Can you please help?

PHP version is 8.1

Thank you,

Thomas

3 Answers
Abu Ghufran Staff answered 1 year ago

Hello,

Alert box with no message means that error reporting OR display error is some-how not working.

You need to check php error log file and see the exact reason of the issue.

You can also inspect the ajax call response of the delete operation.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Thomas answered 1 year ago

Hello,

no I checked this via browser console.

The reason are different paths. The script file itself is located in a protected folder.

Due to the accessibility the graphics are stored outside this protected folder. So everything works fine, but that’s the reason why the graphics are not displayed in grid.

So no we have to modify the line “$upload_url = explode(“/”,$_SERVER[“REQUEST_URI”]);” to point to the same folder as given as “$col[“upload_dir”] = “../../../images/uploads…”

How can I do this?

For better understanding see attached screenshot

different paths

Abu Ghufran Staff answered 1 year ago

Hi,

You can simply test hardcode the value of upload_url, e.g.

$upload_url = "https://domain.com/.../images/upload_itrena/";

If this works, you can then play with $_SERVER[“REQUEST_URL”] and remove the hardcoded text.

to debug, you can use phpgrid_error($upload_url); inside display_icon callback function.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

11 + 3 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?