I've tried so much codes found on the internet but can't get it to work. Maybe due to different Alfresco version or PHP version, I don't know.
I successfully upload new file through POSTMAN. Now I want to upload file using Dropzone.js and pass it to PHP file.
Here's my POSTMAN:
When uploading using Dropzone.js, the PHP file receive the file through $_FILES. Here's the var_dump($_FILES):
Here're two of my latest codes that are not working:
CODE 1:
CODE 2:
Note that dropzone.css is located on same folder as the php file which received the upload.
Solved! Go to Solution.
I don't use PHP anymore, but when using curl in bash scripts, I have to use a '@' as prefix for the filepath to let curl know that filedata is a filename and not the content of the file.
Have you tried (for example) filedata=@dropzone.css or "filedata"=>"@" . $_FILES... ?
I've tried these two as your suggestion but fail:
$data = http_build_query(array('filedata' => "@"."dropzone.css", ...));
$data = array('filedata' => "@"."dropzone.css", ...);
Got this error:
An error inside the HTTP server which prevented it from fulfilling the request
Yes. i have look at it. His $_FILES is same as me but his approach seems totally different. He include "Alfresco/Service/xxx" library which I didn't. I successfully login and create new folder without "Alfresco/Service/xxx". I'm trying to do this:
File upload | Alfresco Documentation
Which didn't suggest me to use "Alfresco/Service/xxx"
I don't know whats happening when all replies gone missing (Can I even delete replied message?). Anyway, I found the solution after being lead by your URL suggestion. I thank you for all your help Martin Ehe
Here the final code:
could you pls send the whole code for this?
thanks
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.