Re: Posting from memory?

olga wrote:
> I am posting the document ASIS. The function requires that the document should
> be in memory. What does it mean? I have seen that the document is of type (void
> *). Could it be a file read stream? Should I somehow indicate what type of
> document I am using by setting appropriate input format?
> 
> Now I am using the character array (as in examples). My problem is that the
> documents are huge and system often cannot allocate the required amount of
> memory to load the complete file.
> 
> So  the question is: Can I use file (or file reader stream) for posting document
> ASIS? If I can then how to setup this usage (format?). If it is not possible
> then how to get around the problem?

No, you can't use a file pointer. There is in fact no functions in the
current HTAccess API that covers what you want. An old version had
something like it - it took a URI as source and a URI as destination and
created a direct pipe between the two streams.

In general this turned out to be too hard - there are too many reasons
for the destination to not immediately accept the data (redirection,
authentication, etc.) and have the source stream pending on this with
the potential od recovering a timed out connection was just too much.

Therefore, the somewhat more wasteful but also more reliable solution of
first getting the source into memory and then do the PUT or POST from
there.

It is possible to take advantage of the fact that local file systems
often are more reliable and hence this particular case can be optimized.
I won't have time for a week or so before I can get around to do that,
though.

Henrik

Received on Sunday, 10 January 1999 21:21:11 UTC