This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

PHP Ajax multipart form data using method GET  RSS feed

 
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: 21641
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor 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: 21641
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor 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: 21641
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And to you too.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!