The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 23, 2019, 01:50:14 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Image transfer API  (Read 3536 times)
kurdt
Lifer
*****
Offline Offline

Posts: 1153


paha arkkitehti


View Profile
« on: February 26, 2010, 12:20:43 AM »

I have to build API that you can use to send images. Now what's the best way to do this? I was thinking about doing just plain old POST API. Is there any standards how this should be done? I would prefer solution that doesn't involve huge libraries that API users have to download. In perfect world it would be native PHP functions and maybe CURL.

My first idea was to just to base64_encode() the image and send it as normal POST variable but base64_encode() adds about 33% more to the size. This starts to add up when you have image repository where photographers send big images and A LOT of them. So is there another more lightweight way to do this?
Logged

I met god and he had nothing to say to me.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: February 26, 2010, 12:30:40 PM »

"send images..."

I'm not sure what your intention is. You talk about about POSTs but sending and an API. And this topic is in PHP. So I assume it's a server-side solution. I'm not sure I understand why you'd not just let Apache deliver things upon request ... but clearly that's because I don't understand what you want  ROFLMAO
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
kurdt
Lifer
*****
Offline Offline

Posts: 1153


paha arkkitehti


View Profile
« Reply #2 on: February 27, 2010, 12:43:25 AM »

"send images..."

I'm not sure what your intention is. You talk about about POSTs but sending and an API. And this topic is in PHP. So I assume it's a server-side solution. I'm not sure I understand why you'd not just let Apache deliver things upon request ... but clearly that's because I don't understand what you want  ROFLMAO
Hehe, sorry for not explaining myself clear enough, happens quite often :/

Anyway, the idea is simple: User has a script that sends image files from computer A to computer B.

So what I was thinking was that I could just do API that accepts POSTs. So you could do $post = array('user_id' => 'f00', 'api_key' => '0F0F', 'image' => base64_encode($imagefile)); and then just send it forward as POST with CURL. But I'm not sure if this is the best day to do it. Everybody seems to be saying that I should do RESTful API but I haven't ever done one and I'm not sure it's worth the hassle when I just need to get this done asap.
Logged

I met god and he had nothing to say to me.
DangerMouse
Expert
****
Offline Offline

Posts: 244



View Profile
« Reply #3 on: February 28, 2010, 10:54:33 AM »

I'm not sure I'm following the requirements exactly, but a RESTful API is just one that uses standard HTTP request methods to instigate action, in this instance POST is appropriate because its telling the recipient to "create" a resource i.e. the image being sent.

DM
Logged
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #4 on: March 01, 2010, 02:39:12 PM »

You won't be able to transfer a file with a regular form POST either. You need to use multipart or you're not getting anything that's of a binary MIME type across.

Otherwise, have the server pull it from the client.
Logged

hai
arronlee
n00b
*
Offline Offline

Posts: 4


View Profile
« Reply #5 on: December 15, 2013, 07:28:12 PM »

Hi, I am almost a green hand on the Image transfer API. But I am testing with the related Imaging SDKs these days. And I want to look for some professional Imaging Toolkits whose way of processing is simple and fast to help me with the related work.  It will be better if it is totally manual and can be customized by users according to our own favors. Do you have any ideas about it? Or any good suggestion? Thanks in advance.



Best regards,
Arron
Logged

Best Regards,
Arron

Next Tomorrow is Another Day.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #6 on: December 17, 2013, 07:35:52 AM »

If you're not a 'bot Arron, then please be more specific about what you need to do with images, what kind of language you'd like to use and what the intention is.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Nana111
n00b
*
Offline Offline

Posts: 4


View Profile
« Reply #7 on: January 13, 2014, 07:28:25 PM »

Hi, I am almost a green hand on the Image transfer API. But I am testing with the related Imaging SDKs these days. And I want to look for some professional Imaging Toolkits whose way of processing is simple and fast to help me with the related work.  It will be better if it is totally manual and can be customized by users according to our own favors. Do you have any ideas about it? Or any good suggestion? Thanks in advance.



Best regards,
Arron

HI arron
There are many third party professional image toolkits .You can just google for it.And choose the most suitable for you.Or you can post a new questions for this issues
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!