我在服務器上實現了ng2文件上傳。我應該在哪裏創建上傳文件夾,並在本地主機上實現ng2文件上傳時放置upload.php:4200
它要求api網址,我提供了它。一切都按預期在線工作。 但我想在本地運行它進一步實施。
這是我上傳API網址 -
const URL = 'http://example.com/v8/products-api/upload2.php';
In upload2.php the path is given as $path = 'uploads/';
我的問題是,應該在哪裏我創建這個文件夾,並在那裏將我放在這個PHP文件?
我無法從http:localhost:4200
文件上傳到服務器,因爲它提供了以下錯誤:
XMLHttpRequest cannot load http://funiks.com/adminv8/products-api/upload2.php. Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:4200' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
我的PHP包括header("Access-Control-Allow-Origin: *");
請告知