//import http from "../http-common";

import { Axios } from '../context/UserContext';

const upload = (file: File, onUploadProgress: any): Promise<any> => {
  let formData = new FormData();

  formData.append("file", file);
  formData.append("submit", "1");

  let uploadRes = Axios.post("upload.php", formData, {
    headers: {
      "Content-Type": "multipart/form-data",
    },
    onUploadProgress,
  });

  // let a: number = 1+3;
  // a++;
  return uploadRes;
};

 
  const FileUploadService = {
    upload
  };
  
  export default FileUploadService;