RTC Forums
November 24, 2024, 02:43:55 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Combining Lesson 6 and and QuickStart Client Upload project failed  (Read 6284 times)
dpcroghan
RTC Expired
*
Posts: 17


« on: September 25, 2013, 10:40:06 PM »

I am a new RTC SDK user trying to make a project with
1) a client application that will upload or get a file from a server and
2) a server that will listen for Put and Get requests.

For now I would be satisfied to get it working using localhost. I began with the QuickStart ClientUpload project and it worked. To it I added a TrtcDataRequest component and set it up for get requests using the web lesson 6 (client to get a file from any web server). To write the file to disk I looked at the code in the Demos\File_Client project. To the server project I added a TrtcDataRequest component and set it up to listen for get requests.

The puts still work fine but I get no response from the server for the get. I added debug messages and the CheckRequest event of the getfile datarequest object is never accessed. The server onListenError and OnInvalidRequest also do not fire. My URL from the client to the server is simply localhost/mytestfilename.txt. Is this incorrect perhaps for a get request?


Could anybody take a quick look at my sample project and maybe see what I am doing wrong?

Thank you
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: September 26, 2013, 08:07:44 AM »

1. Have you connected the RtcDataProvider component to RtcHttpServer component (Server property)?
2. Have you assigned a value to the Port property of the RtcHttpServer component?
3. Have you called Liste on the RtcHttpServer component?

To get basic understanding of the RTC SDK, please go through all QuickStart lessons.

Best Regards,
Danijel Tkalcec
Logged
dpcroghan
RTC Expired
*
Posts: 17


« Reply #2 on: September 26, 2013, 04:54:06 PM »


Thank you Danijel. I will go through the Quick Start lessons again, especially in regard to the RTCDataProvider.
Logged
dpcroghan
RTC Expired
*
Posts: 17


« Reply #3 on: October 04, 2013, 06:44:17 PM »

I succeeded getting my test project working for Gets and Puts. I was wondering what would be the best way to encode a subdirectory name to put the file in or get the file from? Should this just be appended to the file's name in the URL?

Thanks!
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #4 on: October 04, 2013, 07:23:13 PM »

That depends on your design goals. If you want to make it easy for someone to access files through a Web Browser, you can use part of the URI as relative path from documents root. Just make sure there are no special characters used (like "..") and check that the absolute path is really inside the folder where the user has access to.

Best Regards,
Danijel Tkalcec
Logged
dpcroghan
RTC Expired
*
Posts: 17


« Reply #5 on: October 04, 2013, 07:38:38 PM »

The files will be created and moved programmatically (via the HTTP Gets or Puts) as part of a site's daily work flow in a Delphi application. Each office has satellite locations with each they need to exchange data asynchronously. Each location has a siteID which could also be the subfolder name from the document root. Once the files are local they will be processed. Given these design goals would you consider other options for specifying a subdirectory name?

Thank you Danijel,
Ric
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #6 on: October 04, 2013, 08:04:18 PM »

There are several "locations" where you can send the file path through:

1) As part of the URI, directly in the Request "FileName" portion (before parameters) or as Query paramters. Sending file paths inside the URI is fine, as long as your paths don't start getting too long. Some proxies have limitations in how long an URI may be and might either refuse forwarding your request, or forward only part of it when the limit is exceeded.

2) As a custom HTTP header value. Sending paths inside HTTP header variables is not something I would recommend, but it should work, as long as you encode the data properly.

3) As part of the request content body. Sending the data in request content body is probably the cleanest solution, you need to use a format which is flexible enough to hold any other information required

Now, it is up to you to decide.

Best Regards,
Danijel Tkalcec
Logged
dpcroghan
RTC Expired
*
Posts: 17


« Reply #7 on: October 04, 2013, 08:22:52 PM »

Perfect, thanks.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.026 seconds with 17 queries.