04-09-2018 08:00 AM
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.
04-09-2018 09:35 AM
04-09-2018 08:31 AM
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... ?
04-09-2018 08:58 AM
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
04-09-2018 09:35 AM
04-09-2018 07:29 PM
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"
04-09-2018 09:55 PM
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:
10-30-2019 03:23 AM
could you pls send the whole code for this?
thanks
Explore our Alfresco products with the links below. Use labels to filter content by product module.