Re: file to blob

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, October 3, 2006 2:38 pm, Joshua Capy wrote:
> I am relatively new to php and could use a good pointing in the right
> direction.
>
> I have a soap client in NuSoap that I developed for a webservice that
> I wrote in another language and I need it to be able to send a file
> in a blob.
>
> I can't find an example of how you load a file in its entirety (not
> just the content) into a blob in PHP. I need to be able to do this
> because the webservice that is being called recreates the document
> locally for the user.

In Un*x, there is nothing in a file other than its content.
$data = file_get_contents($fullpath);

In Windows, some files are "binary" and need special handling for
fopen to get them as binary.  Presumable file_get_contents does that
correctly as binary.  (At least, *I* think it should do that...)

On old old Mac OS on which PHP probably doesn't even run, you had the
file DATA fork and the file RESOURCE fork where your question would,
in theory, make sense...

All told, though, file_get_contents() gets the whole file in RAM.

How you safely encode that for transmission through the mysterious
not-nuSoap medium you didn't bother to tell us is beyond everybody,
other than any clairavoyants (sp?) who happen to be reading. :-)

I'm thinking you maybe just want to send a link to an FTP site where
the file lives...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux