Skip to content

Instantly share code, notes, and snippets.

@fakiolinho
Last active May 12, 2018 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fakiolinho/a6f867e00ed2c9bb39cf701f6eb86606 to your computer and use it in GitHub Desktop.
Save fakiolinho/a6f867e00ed2c9bb39cf701f6eb86606 to your computer and use it in GitHub Desktop.
import request from 'utils/request';
export const uploadFileRequest = ({ file }) => {
const data = new FormData();
data.append('file', file, file.name);
return request.post(`/files`, data, {
headers: {
'Content-Type': `multipart/form-data; boundary=${data._boundary}`,
},
timeout: 30000,
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment