Home > front end >  Could you tell me how to put the photos to React under axios local request when a certain folder add
Could you tell me how to put the photos to React under axios local request when a certain folder add

Time:05-11

Want to be familiar with the axios, after to get a picture from local, through axios asynchronous upload local another folder, at this time of the request to address how to write?
Tried "http://127.0.0.1:3000/+ local path" results not
Thank you very much!
Is the post request urls in how to write
 
UploadFile=(e)=& gt; {
Const param=new FormData ();
Param. Append (" file ", this. State. ImagePreviewUrl);

Const config={
The content-type headers: {" ":" multipart/form - the data "}
};
Axios. Post ("/url "param, config). Then (res=& gt; {
console.log(res);
});
};
  • Related