/    Sign up×
Community /Pin to ProfileBookmark

Binary data of an image

Hi all,

Anyone know how to get the binary data of an image? ?
The scenario is this:

I am part-way through building an application that will allow my fellow colleagues to simply enter a product code into a form, and the relevant product photo will be uploaded to twitpic (twitter’s image library) automatically.

I’m looking at the API for twitpic, and it requires the information to be sumbitted via a form:

[B]The image in question needs to be ‘Browsed for’…[/B]

This is annoying. I don’t want to have to browse for a file that I already have on our server!!

I can see a way round it though – which would be to post the binary data of an image that we have on our server.

[B][SIZE=”4″]However, in order to do this – I need to retrieve the binary data of the image in question![/SIZE][/B]

I haven’t a clue where to start. get_file_contents, seems to only show the product on the screen, and I can’t see any information in the php.net/gd help files…

Any information would be greatly appreciated!

Thanks in advance,
Rachael

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@zahidrafMay 16.2009 — This is what you are looking for complete example saving and getting data

http://leoslab.net/how-to-save-image-using-php-mysql/

You have to make a separate images file to get database from db and then include that file in your code.


Sam sung new model

samsung i637 Jack
Copy linkTweet thisAlerts:
@adam_jimenezMay 16.2009 — I think you are on the right track with file_get_contents - that should work.
Copy linkTweet thisAlerts:
@railanc4309authorMay 19.2009 — Hi Guys,

Thank you both of you for your responses,

I've managed to sort it now - I used the binary64 thingy to get the results that I wanted.

Cheers again,

Rachael!
×

Success!

Help @railanc4309 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...