|
| [WB] Get uploaded data in AWP page (using for XMLHttpRequest) |
| Iniciado por guest, 15,sep. 2016 09:39 - 3 respuestas |
| |
| | | |
|
| |
| Publicado el 15,septiembre 2016 - 09:39 |
| I need to upload some file on server using AJAX-request. Does anyone know if it is possible (in principle) to get uploaded data on target server? I mean how can I access it inside AWP-page. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 15,septiembre 2016 - 13:23 |
Hi
the upload file is there for that (two versions, even)
Now if you want to do it entirely by code, the hard part is to access the local file (possible in html 5/JS). After that, you can send anything to the server using ajaxexecute, as long as you encode /decode it properly.
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 15,septiembre 2016 - 14:49 |
Hi, Fabrice. The fact I already have a file locally (sound captured from microphone using WebRTC) and I need to send it remotely. From JS code I can only use XMLHttpRequest for that but it is impossible because Same Origin Policy that forbid to connect "alien" sites (different domain, IP or port). That is why I need an additional intermediate layer (script on my site that upload the file to another site - that is an idea). I could do this using PHP because I have $_FILES array where I can find uploaded files but I am interested if it is possible in WebDev... And it seems it is impossile. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 15,septiembre 2016 - 16:10 |
Hi
as I told you before, it IS possible... the ONLY hard part is to get the local file in the browser code. Once you have it, you put it ina buffer, encode it i n base 64 then send it to the server with ajaxexecute
Best regards |
| |
| |
| | | |
|
| | | | |
| | |
|