laravel-dropbox
laravel-dropbox copied to clipboard
malformed_path when uploading file from laravel
Hi there,
I really broke my fingers while trying to find what I am doing wrong, but I cant find it.
I am trying to upload a pdf file into a shared folder but get
"{"error_summary": "path/malformed_path/...", "error": {".tag": "path", "reason": {".tag": "malformed_path"}, "upload_session_id": "pid_upload_session:ABIFXXXXXXXXXXX ▶"
What I do in a laravel controller is
`$path = '/krueger fred/'.$Q.'T'.$Y.'/facturas emitidas/';
Pdf::loadView('invoices.invoice', $i->toArray()) ->save(storage_path('app/public/').$i->invoice_num.'.pdf');
$result = Dropbox::files()->upload($path, storage_path('app/public/').$i->invoice_num.'.pdf');`
When debugging $path and the file to be uploaded, all looks ok. Only thing is, that the path has whitespaces .. but I cannot change this because they are not managed by us/me.
Funny thing is, when I add the XXXXXX.pdf filename to $path like $path.$i->invoice_num.'.pdf', a NEW FOLDER is created with that name, AND the file is being uploaded INTO that new Folder which then looks like
/krueger fred/3T2022/facturas emitidas/2022-0232.pdf/2022-0232.pdf
Please help me outta here.
best regards, O