bbm Posted January 17, 2018 Share Posted January 17, 2018 Hi, I'm sending a PDF document with the command UniSession.SendStream to the client. Is there any way to show the user the document after sending in a form? Bets regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17, 2018 Share Posted January 17, 2018 Hi, And what if you will use UniPDFFrame for this ?! \FMSoft\Framework\uniGUI\Demos\Desktop\PDFViewer - UniPDFFrame Best regards, Quote Link to comment Share on other sites More sharing options...
bbm Posted January 17, 2018 Author Share Posted January 17, 2018 Hi, yes, but how can I bring the document to the UniPDFFrame? Best regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17, 2018 Share Posted January 17, 2018 Have you seen this demo ?!: \FMSoft\Framework\uniGUI\Demos\Desktop\PDFViewer - UniPDFFrame Quote Link to comment Share on other sites More sharing options...
bbm Posted January 17, 2018 Author Share Posted January 17, 2018 Yes, I have seen the demo, but when I send the stream (UniSession.SendStream), how can I use any URL? In the demo there are some PDF documents in the files directory. I think the sent file is stored in the user directory of the current user. Best regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17, 2018 Share Posted January 17, 2018 Yes, but after saving the file by the user, you can not access the user's directories... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17, 2018 Share Posted January 17, 2018 http://forums.unigui.com/index.php?/topic/8053-unisessionsendstream-unisessionsendfile/&do=findComment&comment=41195 Quote Link to comment Share on other sites More sharing options...
bbm Posted January 17, 2018 Author Share Posted January 17, 2018 Yes, this is my problem. The idea was not to see the popup for opening or saving the file. Instead of the popup I wanted to stream the PDF directly to the UniPDFFrame. Is there any possibility? Best regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17, 2018 Share Posted January 17, 2018 If I understand you correctly, you can just generate your pdf file, save to the server side and show in UniPDFFrame Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17, 2018 Share Posted January 17, 2018 Also look at these demos: \FMSoft\Framework\uniGUI\Demos\Desktop\Report Builder \FMSoft\Framework\uniGUI\Demos\Desktop\SendFile Quote Link to comment Share on other sites More sharing options...
irigsoft Posted January 18, 2018 Share Posted January 18, 2018 Hi, I generated pdf file, send to client and show like this: UrlFilePath := 'SavePath' {Fisical path on server} + '\' + FileName; //make windows path to URL path UrlFilePath := StringReplace (UniSession.URL + UrlFilePath,'\','/',[rfReplaceAll]); //If is Desktop platform If UniApplication.UniPlatform = [upDesktop] then begin UniSession.AddJS('var myWindow = window.open(''' + UrlFilePath + '.pdf''', ''_blank'');' + 'myWindow.print();' ); end else begin UniSession.AddJS('var myWindow = window.open(''' + UrlFilePath + '.pdf''', ''_blank'');' ); end; Hope this help. Quote Link to comment Share on other sites More sharing options...
bbm Posted January 19, 2018 Author Share Posted January 19, 2018 Hi, thank you for your support. I think this is a good solution for me. I will show a new form with a uniPDFFrame to show the document. Thank you all Quote Link to comment Share on other sites More sharing options...
bbm Posted July 3, 2018 Author Share Posted July 3, 2018 Hi, is there any restriction on the name extension of a filename? I wanted to send a file with the extension '.cli', but unfortunately without success. Best regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 3, 2018 Share Posted July 3, 2018 Hi, procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin MimeTable.AddMimeType('cli', 'application/cli'); end; Quote Link to comment Share on other sites More sharing options...
bbm Posted July 3, 2018 Author Share Posted July 3, 2018 Hi, thank you very much! Works perfect. Best regards Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 17, 2023 Share Posted January 17, 2023 The following procedure will not be executed. Where to set it up. procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin MimeTable.AddMimeType('*', 'application/*'); end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17, 2023 Share Posted January 17, 2023 6 minutes ago, Ki Sung Kim said: MimeTable.AddMimeType('*', 'application/*'); What do you expect? Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 18, 2023 Share Posted January 18, 2023 Problem downloading file. UniSession.SendStream(S, qtList.FieldByName('FileName').AsString); Two files with extension pptx or gbr cannot be downloaded. This is the inquiry I made of. Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 18, 2023 Share Posted January 18, 2023 I solved it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.