NetTalk Central

Author Topic: Streaming a file to NT server  (Read 2708 times)

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Streaming a file to NT server
« on: May 30, 2013, 01:34:15 AM »
Hi,

I have a client that now wants to stream a file(CSV) to our server. This is what he is asking;

"Is there a way I can send you a file via a stream?  Meaning I will have an array of bytes that is the file.  
Mostly since I am getting rid of the FTP server, I would rather not have to write a file out to somewhere and then send you that file."

Since I am new to this NTWeb stuff, can this be even done with NT? If so are there any ideas/examples of streaming data to a NT Server?


Ashley
« Last Edit: May 30, 2013, 01:36:21 AM by astahl »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Streaming a file to NT server
« Reply #1 on: May 30, 2013, 02:24:16 AM »
Hi Ashley,

I think it will become clearly if we're a little more precise with the terminology.
Since (I presume) we're talking about a WebServer here - presumably on the client side you would have a NetWebClient (although you don't mention if the client side is a Clarion program or not.)

I'm also not 100% clear on whether the thing you want too send is a file on the disk, or a "big string". I _think_ it's a big string, but perhaps confirm that. Do you have the "whole string" or are you adidng to the string while you are sending it?

The short answer to your question is "yes" (I think) but the details of exactly how to do it depend a bit on some of your answer to the questions above.

cheers
Bruce


astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Re: Streaming a file to NT server
« Reply #2 on: May 30, 2013, 02:57:14 AM »
Hi Bruce,

Yes I am speaking about a NT web server on our side. The client is using C# .Net to write the client side software.

From my understanding is that they have a program which creates the data. So instead of writing a file to disk and then send,
they want to send a "big string" of data produced in memory to our web server. I will try and get there exact specs on what they want to do.

Sorry about the clarity of my previous post, but this is all new to me and an entirely new way of thinking.

Ashley

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Streaming a file to NT server
« Reply #3 on: May 30, 2013, 05:17:36 AM »
Hi Ashley,

ok - the short answer is that the web server supports HTTP. With HTTP it is possible to send a POST which contains data. There are a few standard ways of formatting that data which they can use.

So the short answer is yes, they can send you data which you can process and save. The longer answer is that they need to send it, and then you can inspect it, see what the format is, and get more advice about what to do with it when it arrives.

If they want the "generic" answer then the "correct" way for them to do it is to POST the file as a file upload to a web form. they'll either know how to do that, or not - but I guess you'd need more information for us to be more specific.

but the short answer to them is "yes".

cheers
Bruce