필터 지우기
필터 지우기

how to save xlsx, docx or pdf file from web app to local folder ?

조회 수: 10 (최근 30일)
Jay
Jay 2023년 11월 24일
댓글: Jay 2023년 11월 27일
Hello All,
I am been trying to download the files which are stored in the seessions of web app server to my local pc.
I have used "uiputfile" function as well but that does not seems to work. I am able to see that file is stored in session and just that I am not able to download it.
Also I want to create a hyperlink though which user can download .xlsx files direclty to their folder. (This is also connected to this question)
I am using matlab 2021b version.
Let me know if you have have any solution to this.

채택된 답변

Kojiro Saito
Kojiro Saito 2023년 11월 27일
uiputfile just creates a full path for downloading file in server side, so you need to execute writetable (for .csv and .xlsx) and copyfile (for other file formats).
Here is a sample to download a PDF file from Web App.
[file,path] = uiputfile('test.pdf');
if isequal(file,0) || isequal(path,0)
disp('User clicked Cancel.')
else
str = which('test.pdf', '-all');
if ~isempty(str)
copyfile(str{1}, fullfile(path, file))
end
end
  댓글 수: 1
Jay
Jay 2023년 11월 27일
Thankyou @Kojiro Saito.
I have got the results I was looking for. I want not using a copyfile function to download the file from server to local pc.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by