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

Upload Problem of file #21

Closed
Shivek-brightcode opened this issue Jul 25, 2019 · 4 comments
Closed

Upload Problem of file #21

Shivek-brightcode opened this issue Jul 25, 2019 · 4 comments

Comments

@Shivek-brightcode
Copy link

Code is after following your step's of previous upload issue raised is :-
<?php require_once('init.php'); use Ilovepdf\UnlockTask; //with your credentils $myTask = new UnlockTask('project_public_1c8**','secret_key_f**'); try{ $file = $myTask->addFile('Bt21to27july2019.pdf'); } catch (\Exception $e) { var_dump($e); } ?>

This Returns up as below mentioned :-
`C:\xampp\htdocs\pdftest\index.php:43:
object(Ilovepdf\Exceptions\UploadException)[4]
private 'params' (Ilovepdf\Exceptions\ExtendedException) => null
private 'type' (Ilovepdf\Exceptions\ExtendedException) => null
protected 'message' => string 'Upload error' (length=12)
private 'string' (Exception) => string '' (length=0)
protected 'code' => int 0
protected 'file' => string 'C:\xampp\htdocs\pdftest\src\Ilovepdf.php' (length=40)
protected 'line' => int 191
private 'trace' (Exception) =>
array (size=3)
0 =>
array (size=6)
'file' => string 'C:\xampp\htdocs\pdftest\src\Task.php' (length=36)
'line' => int 191
'function' => string 'sendRequest' (length=11)
'class' => string 'Ilovepdf\Ilovepdf' (length=17)
'type' => string '->' (length=2)
'args' =>
array (size=3)
...
1 =>
array (size=6)
'file' => string 'C:\xampp\htdocs\pdftest\src\Task.php' (length=36)
'line' => int 156
'function' => string 'uploadFile' (length=10)
'class' => string 'Ilovepdf\Task' (length=13)
'type' => string '->' (length=2)
'args' =>
array (size=2)
...
2 =>
array (size=6)
'file' => string 'C:\xampp\htdocs\pdftest\index.php' (length=33)
'line' => int 41
'function' => string 'addFile' (length=7)
'class' => string 'Ilovepdf\Task' (length=13)
'type' => string '->' (length=2)
'args' =>
array (size=1)
...
private 'previous' (Exception) => null
public 'xdebug_message' => string '( ! ) Ilovepdf\Exceptions\UploadException: Upload error in C:\xampp\htdocs\pdftest\src\Ilovepdf.php on line 191

Call Stack #TimeMemoryFunc'... (length=1761)`
@maztch
Copy link
Collaborator

maztch commented Jul 30, 2019

Common problems on upload is incorrect file path and read permission on file. Can you check this?

@Shivek-brightcode
Copy link
Author

I have already check weather the file exists or not(this return's true).I can open that pdf through simple browser, that means read permissions are enabled.

@maztch
Copy link
Collaborator

maztch commented Jul 30, 2019

Php permissions are not the same as user permissions. Can you try to set it to "chmod 777"? (not safe for production, just for test)

@Shivek-brightcode
Copy link
Author

I switched to the API and it is Working Great.

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

No branches or pull requests

2 participants