XMLHttpRequest to download file. POST/GET.

dimaomni

Новичок
Регистрация
24.11.2018
Сообщения
11
Благодарностей
0
Баллы
1
Hi,
I need to download a csv file that is generated after filling form. This file is generated and returned by XMLHttpRequest. I found a variable that contains csv-data. How can I access this variable or emulate downloading this file?
The page does not work with disabled js, and I cannot work with straight-forward URLs.
Is it doable via POST/GET +C# ?
Thanks.
 

Вложения

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
By access file with complete path, the variable page.LastDownloadFile still empty?
 

dimaomni

Новичок
Регистрация
24.11.2018
Сообщения
11
Благодарностей
0
Баллы
1

dimaomni

Новичок
Регистрация
24.11.2018
Сообщения
11
Благодарностей
0
Баллы
1
I managed to access data, but not via page.LastDownloadFile (still didn't find info about this instance), just found how to make a right header request.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
I managed to access data, but not via page.LastDownloadFile (still didn't find info about this instance), just found how to make a right header request.
{-Page.LastDownloadedFile-} is just variable when the last downloaded file path is saved.
It will not help in any way for You.

This is when You click on the file and it downloads somewhere, then You get the path from this variable.
In your case, You just have to look for full file path and do GET request to this link with changing Load to - As File


In Your example url should be finished with .csv this would be url to use in GET.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)