Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

PHP Ajax multipart form data using method GET

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

it's possible or not to use 'GET' method to send data from ajax multipart form data like this :



Currently I used method 'POST' to send data, but it cause pending / stalled on XHR so all the process aborted.

Q1 : if the method must be 'POST' only , could you tell me the solution to avoid pending on ajax request?

Q2 : does the hosting provider have potential to influence the process? (currently I use free hosting to hosting my website)

Please help me, because I can't upload anything if the process still pending / stalled.

Thanks
 
Sheriff
Posts: 21922
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A GET (or DELETE) request can never contain a request body, it only supports query parameters. multipart/form-data is always sent in the request body. This means that you cannot use GET or DELETE, but only use POST or PUT.
 
Rob Spoor
Sheriff
Posts: 21922
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If POST requests are stalled, you need to figure out where. Do a POST to a simple PHP page which only prints out $_SERVER, $_GET, $_POST and $_FILES. That way you can see if the request is successfully received by the server or not. If you see output, then the problem is more likely to be in the PHP code. If you see incorrect output, then the problem is more likely to be in the sending code.
 
gong pex
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh ok thanks for reply

Sorry for long reply because I'm very busy lately.

Happy new year 2019
 
Rob Spoor
Sheriff
Posts: 21922
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And to you too.
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic