1

I have File in Meteor Client side and I want to upload file on the third party server.

try {
    const response = HTTP.post('http://localhost:8000/uploadFile', {
                         data: {
                            file:file
                         },                  
                     });
    // console.log(response.content)
    allPagesInImage = JSON.parse(response.content)
    // console.log(allPagesInImage)
} catch (e) {
    SystemLogger.error('Error using Api.ai ->', e);
} 

I have created Http call for that and send file but it's not working proper and not able to get file on server side

How can i send file to server?

My Third party server is PHP.

Suneel Kumar
  • 1,650
  • 2
  • 21
  • 31
Nitin
  • 881
  • 2
  • 10
  • 37
  • what is the response you're getting? are you getting any errors? – 416serg Jul 20 '17 at 21:02
  • I am getting no data found – Nitin Jul 24 '17 at 07:16
  • Hmmm I'm not sure you are using the right method for that. I read meteor API doc and the first thing here is that `data` is used for JSON objects. I'm not sure you image qualifies as such. https://docs.meteor.com/api/http.html#HTTP-call ... You should start by looking on how to properly retrieve a file using the framework https://stackoverflow.com/questions/10099202/how-would-one-handle-a-file-upload-with-meteor Be aware some are outdated and some have evolved.... – Jason Krs Aug 07 '17 at 12:08

0 Answers0