I am trying to progressively enhance a php project without jquery and minimal javascript if possible. There is an upload page with an html form and a file upload for images. There is also an input for remote image urls. If the user puts an image url in the input I use js to create a blob and append it to the form. This works fine when using javascript to handle the form request and response. But I would like to append the blob to the form without needing to use XMLHttpRequest so php can handle the redirect. I do not want javascript to handle the redirect because I'll need to determine if javascript is enabled and I simply want to enhance the form and not complicate the backend logic.
I use curl on the backend for the same functionality but I would like to do it on the client side if javascript is available.
I've reviewed https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
I've tried making the request synchronous instead of asynchronous to see if if I could get the php redirect to work but this is deprecated.
So far my research suggests there is no way to append anything to a form without submitting the form with XMLHttpRequest.
Using XMLHttpRequest seemingly necessitates javascript handling the redirect which complicates how I handle the response in php.