Is it possible to send a file to a server using ajax without user intervention?

the curl commend used to download the file

curl "http://page/html/downloadconfigfile.conf?RequestFile=/html/file.asp" -H "Cookie: SessionID_R3=dsadwdwqdasdwasdawd" --data "token=saddasdwadawds" --output 1.conf

the question is it possible to send it back to the server without downloading ?
using just xmlhttprequest ?

or if after downloading it without user intervention ?

what i mean is it possible to grab it on the air ( on the go ) or even base64 it ?
make it automatic ?

Hi @minanageh379, I’m not quite sure what you mean… why would a client request a resource but then not actually load it? You don’t have to explicitly save it to the file system though, if that’s what you’re asking; you can indeed just process it in memory without any user interaction. In fact, allowing the user to save the resource would require some extra steps when using AJAX.

is this even possible (cause sending the post request Immediately start the download ! ) ? then send it from memory to a server ?

I still don’t quite understand I’m afraid… so you tried sending a POST request using AJAX, and that would prompt the user to download the requested resource to the file system (or start the download right away depending on the browser settings)?

Can you use AJAX to “download” (load into memory) a file and without intervention post it to another location? Yes. Nothing stops you from piggybacking the output of one AJAX request into another one that is triggered by the resolution of the first one.

how ?
and there is a problem the file encoding get’s broken in the response text that it becomes useless
The meant encoding for it to be viewed probably is binary ( hexadecimal view )
is there any way to make it be viewed as that although the server response headers are

Content-Type: application/x-download;charset=ISO-8859-1

i found it but can’t find the receive php server part !

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.