react-native-background-upload icon indicating copy to clipboard operation
react-native-background-upload copied to clipboard

how do i use this component with my php files on the server?

Open luigbren opened this issue 5 years ago • 0 comments

is there any possibility to use this component with my php configuration? as I normally use in my application..

........
        let filextns = this.getextensionfile(uriImg)
        let formData = {
          filewidth: i.width,
          fileheight: i.height,
        }
        let formDataPost = new FormData();
        for (let p in formData) formDataPost.append(p, formData[p]);
        formDataPost.append('file', {
          type: typeimg,
          uri: uriImg,
          name: 'imag-temp.' + filextns
        })

        const urldata = this.hostconex + 'upfiles.php';
        fetch(urldata, {
          method: 'POST',
          headers: {
            'Accept': 'application/json',
            'Content-Type': 'multipart/form-data',
          },
          body: formDataPost
        })

and on my server php I receive the files using $_FILES['file'], How would I go about using this component, any examples?

luigbren avatar May 01 '20 19:05 luigbren