Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download error when using GROUP FOLDERS #32

Closed
lbdroid opened this issue Apr 5, 2021 · 1 comment · Fixed by #57
Closed

Download error when using GROUP FOLDERS #32

lbdroid opened this issue Apr 5, 2021 · 1 comment · Fixed by #57

Comments

@lbdroid
Copy link

lbdroid commented Apr 5, 2021

server.js log:

pdftk returned an error when merging Error: Unable to find file.
Error: Failed to open PDF file: 
   -
Errors encountered.  No output created.
Done.  Input errors, so no output created.

Apache log:

###.###.###.### - - [05/Apr/2021:13:23:59 -0400] "GET /apps/pdfdraw/download/1928335 HTTP/1.1" 404 192 "-" "-"

This could be solved trivially by using webdav for file operations, which may go along well with #6

@lbdroid lbdroid changed the title pdftk error when using GROUP FOLDERS Download error when using GROUP FOLDERS Apr 5, 2021
@lbdroid
Copy link
Author

lbdroid commented Apr 5, 2021

This problem is caused by tricking the userid out of the storages table here; https://github.com/strukturag/pdfdraw/blob/master/lib/Controller/ApiController.php#L251

Dirty fix:

                $ownerId = "testuser";
                if (empty($homeId) || strpos($homeId, 'home::') !== 0) {
                        //return new DataResponse([], Http::STATUS_NOT_FOUND);
                } else {
                        $ownerId = substr($homeId, 6);
                }
                $files = $this->root->getUserFolder($ownerId)->getById($fileId);

"testuser" has to be a valid uid on the system with access to the resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant