简体   繁体   中英

Lithium PHP Framework - unable to upload files on live site

I'm working on a site, that is live already, and when I attempt to upload a file - I receive "Status Code: 201 Created", but no content after that. And when I run the site locally and upload the file - I get the same status code, but after that I get content - JSON with the data of the newly created file.

In both cases I see in the Mongo database that the file is created, and when I attempt to access it through a controller for it through

http://({domain}file/{{file-id}}

I see the file - even on live.

The problem appears to be somewhere after that saving ... and before [[something]] returns the JSOn with the file data ...

... but because everything in Lithium is soooooooooooooooo muuuuuuucccchhhhhhhh automated ... I don't know how to find the problem.

(And I don't want to dump inside the framework itself ... I'm supposed to use the framework, not to debug it! ...)

Well, the problem appeared to be that after the upload the server should return JSON with the data for the file, but on live json_encode() was returning false because of some non-UTF8 text in the object. I managed to workaround this ... and the solution can be found in this question I posted today: json_encode() turn non-UTF8 strings into null, but on live site returns false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM