RTC Forums
November 01, 2024, 03:24:16 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Login
Register
RTC Forums
>
Subscription
>
Support
>
TRtcHttpServer not saving files from PUT cmd in EXE dir when run as a service
Pages: [
1
]
« previous
next »
Print
Author
Topic: TRtcHttpServer not saving files from PUT cmd in EXE dir when run as a service (Read 4333 times)
PhilH
Newbie
Posts: 3
TRtcHttpServer not saving files from PUT cmd in EXE dir when run as a service
«
on:
August 17, 2015, 03:36:54 PM »
On the client side, I use the TRtcHttpClient component to send a file using the PUT command (I followed one of the demos to write this code). On the server side, I have the TRtcHttpServer. When the Server is run as a Form based application, it receives the files and saves them to the application's folder. When the same application is run as a service, it receives the files OK, and it saves the files to the C:\Windows\System32\LogFiles folder.
I would prefer that the service save the files to the application's EXE folder like the Form based application. Is there some way of setting a root directory on the server side?
Thanks.
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: TRtcHttpServer not saving files from PUT cmd in EXE dir when run as a service
«
Reply #1 on:
August 17, 2015, 04:43:28 PM »
Do NOT use relative paths (always absolute paths) in Windows Service Applications, because the deault folder for all Windows Services is Windows/System32. This has nothing to do with RTC, but is how Windows runs all Services. It is generally a good idea to use absolute paths when accessing files, to avoid this and similar problems. There is a global variable "
AppFileName
" in the "rtcInfo.pas" unit, which will be populated with the full path and name of the EXE being executed, so you can use ExtractFilePath(AppFileName) as a prefix to all files and folders which are relative to the location of your EXE.
Here is an example:
MyLogFiles :=
ExtractFilePath(AppFileName)+
'LogFiles';
Best Regards,
Danijel Tkalcec
Logged
PhilH
Newbie
Posts: 3
Re: TRtcHttpServer not saving files from PUT cmd in EXE dir when run as a service
«
Reply #2 on:
August 17, 2015, 05:25:22 PM »
Hi Danijel,
Thanks for information. I see where I need to edit the file name info.
Thanks,
Wes.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...