Jump to content

UniSession.SendFile with "RTF" extention is not working


commander

Recommended Posts

Hello.

This code is not working (file is not sending) in three different browsers and two computers:

UniSession.SendFile(UniServerModule.FilesFolderPath + 'r.rtf');

But this code works perfectly:

UniSession.SendFile(UniServerModule.FilesFolderPath + 'r.doc');

Of course both of files are present.

Even this option does not work:

UniSession.SendFile(UniServerModule.FilesFolderPath + 'r.doc', 'r.rtf');

UniGUI version is 1.90.0.1514.

Here is my example.

SendFile_RTF.zip

Link to comment
Share on other sites

42 minutes ago, commander said:

UniSession.SendFile(UniServerModule.FilesFolderPath + 'r.rtf');

Hello,

procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
  MimeTable.AddMimeType('rtf', 'application/rtf', False);
end;

 

Link to comment
Share on other sites

3 minutes ago, Sherzod said:

Hello,


procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
  MimeTable.AddMimeType('rtf', 'application/rtf', False);
end;

 

It works! Thank you!

Is it means I can't use random extensions without mime type registration?

Link to comment
Share on other sites

20 minutes ago, commander said:

Is it means I can't use random extensions without mime type registration?

"Under normal conditions for security reason only safe file types are allowed to be transferred from the server. You can define as much as mimes needed here."

Link to comment
Share on other sites

  • 2 months later...

Thank you for this information, which solved my problem with Mime-Types, partially for my Windows 2016 server. 

Next to this I also needed to adjust supported Mime Types in the IIS Manager (see screen shot below).

IIS.thumb.png.72eae948b3d0bc1d6a7ea0cc278834a0.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...