Proxy status instead of file when Uploading files - reactjs

Uploading files using antd Dragger component, everything works fine but when I upload the files, I get Proxy status in response instead of file? What does proxy here represent?
I am using this example https://ant.design/components/upload/#components-upload-demo-drag. Why am I not getting file in response directly?

Based on #29614
Upload should always return new file proxy.
If you need to object install for example antd#4.9.1. Then it returns object to you.

Related

React i18next-http-backend won't load translation json file from Public folder

I have React app in which I am trying to get language options set up using i18next http backend. However it seems that when the call is made to get the json file it is not returned correctly.
My json files are stored in the Public folder in a subfolder locales and the call to fetch these is made:
backend: {
loadPath: "/locales/{{lng}}/translation.json",
},
Looking at the network tab I am getting 200:
But if I put that URL directly into the browser I get the app navbar and an empty page as if it is loading an instance of the app, rather than grabbing the json file.
How do I get around this?
This was resolved by creating a .env file in the root of the project and adding the line PUBLIC_URL=sub_folder where subfolder was where my app was.

After deploy my react app returns an error that cannot load a js file

I have an json file in the public folder, to which after starting the application I make a request to it. When I load the application from a port on which I hosted it, everything is fine, but when I change the port with some url (test.project.bg) this json file does not build or somehow does not find the way to it.

Unable to locate json data file while making http get request in angular cli project

Repo: https://github.com/avalokkumar/gametrackers
I'm unable to make http request to src/games-data.json from app/games/shared/GamesService as it is not able to locate the file path correctly.
Please suggest any solution.
Thanks.
Changing the path src/games-data.json to src/data/games-data.json in app/games/shared/GamesService did the work.

Angular 2 loading local json file 403 forbidden error

Seems so simple from examples I see on the web but when I try to load a local json file from my Angular 2 application inside my service.ts, I get a 403 forbidden error. My application runs inside a Servicestack selfhosted service. Works fine when I do a request like http://localhost:8087/customers/ but the same data inside a local json file in my app directory will not (http://localhost:8087/app/customers.json)
What do I have to do to allow my application to access that file?
this._http.get('app/customers.json').toPromise()
.then(function (response) {
console.log(JSON.stringify(response))
}).catch(this.handleError);
Suggestion from #mythz fixed my issue.
I added this line in my appHost file.
HostConfig.Instance.AllowFileExtensions.Add("json");

how to upload a file using libcurl in c

I am building an application and I want it to upload a file using http
. I am doing this using libcurl. I would like someone to give an example on how to upload a file, either in c using lib curl. Thanks in advance!
See the file upload example in the cURL docs and change the protocol from file to whatever you want to use: http://curl.haxx.se/libcurl/c/fileupload.html. Note that CURLOPT_UPLOAD will send a PUT request when doing HTTP.
Or check out the FTP upload example: http://curl.haxx.se/libcurl/c/ftpupload.html

Resources