Jump to content


Photo

Execute file in client side


  • Please log in to reply
6 replies to this topic

#1 Tonivi

Tonivi

    Member

  • uniGUI Subscriber
  • PipPip
  • 33 posts

Posted 12 November 2017 - 08:50 AM

Hi
 
Is it possible to execute a .exe file in client side, or if not, how can I send a file from server to client side? 
 
Thanks
 

  • 0

#2 mika

mika

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 108 posts

Posted 12 November 2017 - 02:05 PM

You can send file to client by using UniSession.SendFile(...);

 

However, you *cannot* execute anything on the client side automatically. That would destroy the whole internet and quite possibly cause a rip in space time continuum.


  • 0

#3 Tonivi

Tonivi

    Member

  • uniGUI Subscriber
  • PipPip
  • 33 posts

Posted 12 November 2017 - 05:20 PM

ok, I send a file as sendfile to the cache directory of the server, I can open if it's a word, excel, pdf, txt, but I cann't open if it's a .msg.

is there any way to open theses files.


  • 0

#4 mika

mika

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 108 posts

Posted 13 November 2017 - 06:57 AM

I don't understand your problem? Can you clarify?

 

If you use UniSession.SendFile(...) to send file from server to client, whether client can open file you sent, depends on software installed on clients machine. That's not something that can be controlled on server side.


  • 0

#5 Tonivi

Tonivi

    Member

  • uniGUI Subscriber
  • PipPip
  • 33 posts

Posted 13 November 2017 - 08:18 AM

I run the sendfile command, UniSession.SendFile (vOrigin, vTarget); 
The file is copied from the server path to the cache route of this session, ignoring the destination route, and asks me on the client side, if I want to save and then open.
 
The sendfile doesn't send anything to the local disk. 
Also, in all the files that I pass, it works well for me, except for those that have the extension .msg (outlook).
 
My question is why Can I not open these files (.msg).
And the other question is, can I send these files to a local disk?

  • 0

#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3432 posts

Posted 13 November 2017 - 09:24 AM

Hi,

 

You need to add mimetype to MimeTable:

 

UniServerModule -> OnCreate:

procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
  MimeTable.AddMimeType('msg', 'application/vnd.ms-outlook', False);
end;

Best regards,


  • 0

#7 Tonivi

Tonivi

    Member

  • uniGUI Subscriber
  • PipPip
  • 33 posts

Posted 13 November 2017 - 10:02 AM

It Works Perfect

 

Thanks


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users