We don't stream files
Currently the way we use request creates the multipart message and then sends it off. This requires us to build the message in memory before sending. Large faxes (many page pdfs for example) could be a problem to send. Ideally we'd stream the data one by one out into the request. I'd need to look closer at request's internals to see if it's possible to use it to do it.
+1, this would be very helpful for me. I'm using pdfkit, which is a node library for creating screaming PDF documents. Pumping directly from pdfkit to phaxio would be extremely awesome.
This is very much possible. Happy to to review/merge any pull requests if you want to try to add it in.
I'm not if this would require streaming per se, but can I send a BASE64 encoded pdf file in memory? Or do I need to save the document to a file system, then refer to that document? (this might be a deal breaker for us) Due to HIPAA regulations, storing the pdf file on any persistent storage causes us lots of issues. The notification system that will be interacting with the FAX API receives a JSON message with the pdf document BASE64 encoded inside of it. I'd like to simply send that representation to be faxed. Will that work?
Thanks! I really like Phaxio and would love to use it for this project.
Phaxio does this on their official PHP library: https://github.com/phaxio/phaxio-php/blob/32452c819e4553d64a6e52e9a7932d7a46e8a1d3/lib/Phaxio/Phaxio.php#L328-L331
file_get_contents returns the file's content in a string.
So I'm sure something similar can happen in Node.
It could very easily happen with node.
On Thu, Mar 17, 2016, 10:32 PM Richard Lai [email protected] wrote:
Phaxio does this on their official PHP library: https://github.com/phaxio/phaxio-php/blob/32452c819e4553d64a6e52e9a7932d7a46e8a1d3/lib/Phaxio/Phaxio.php#L328-L331
file_get_contents http://php.net/manual/en/function.file-get-contents.php returns the file's content in a string.
So I'm sure something similar can happen in Node.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/chadsmith/node-phaxio/issues/3#issuecomment-198168415
@namlet I'm working on a new version but this version uses string_data if you want to send a raw string of the file. (Not base64 encoded, you'll have to decode it)