Using Zend_Rest to move image files

View: New views
3 Messages — Rating Filter:   Alert me  

Using Zend_Rest to move image files

by Ron Dyck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'd like to move image files from a Zend_Rest client to a Zend_Rest server.
I'm assuming this is possible utilizing the client post method.

Does anyone have any comments on this? I'm hoping this should be fairly simple but would appreciate any suggestions before I start spinning my wheels.

Regards,
--
=================
Ron Dyck
pulpfree1@...
www.webbtech.net
=================

Re: Using Zend_Rest to move image files

by tfk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 17, 2008 at 7:48 PM, Ron Dyck <pulpfree1@...> wrote:
> I'd like to move image files from a Zend_Rest client to a Zend_Rest server.
> I'm assuming this is possible utilizing the client post method.
>
> Does anyone have any comments on this? I'm hoping this should be fairly
> simple but would appreciate any suggestions before I start spinning my
> wheels.

It's probably PUT. :-)

Do you need an example of how to use Zend_Rest_* or are you using it
with a public API?

Till

Parent Message unknown Re: Using Zend_Rest to move image files

by tfk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey there,

I am CC-ing the list again.

On Fri, Jul 18, 2008 at 9:17 AM, Ron Dyck <pulpfree1@...> wrote:

> On Fri, Jul 18, 2008 at 2:49 AM, till <klimpong@...> wrote:
>>
>> On Thu, Jul 17, 2008 at 7:48 PM, Ron Dyck <pulpfree1@...> wrote:
>> > I'd like to move image files from a Zend_Rest client to a Zend_Rest
>> > server.
>> > I'm assuming this is possible utilizing the client post method.
>> >
>> > Does anyone have any comments on this? I'm hoping this should be fairly
>> > simple but would appreciate any suggestions before I start spinning my
>> > wheels.
>>
>> It's probably PUT. :-)
>>
>> Do you need an example of how to use Zend_Rest_* or are you using it
>> with a public API?
>
> I'm developing an application where a 'client' site communicates with a
> 'api' in a 'RESTful' architecture. This is my first go at this and things
> are going well thanks to the the Zend_Rest component.
>
> With all requests a key is required for making requests to the api. When
> moving files to the api I want to ensure that the api is not getting
> 'hammered' with files from unauthorized users. The transaction I envision
> goes something like this:
>
> 1. client submits image file to api
> 2. api receives and processes file; resize, create thumbs, creates db entry
> etc. and returns success or failure status.
> 3. on success client is redirected to page where client may add
> descriptions, tags etc. to image.
>
> In the inital submit transaction I need to send the client key, receive the
> image file and return a status. I suppose the return of status is still good
> with a PUT?

Yeah, why not. Depends on your implementation. In anyway:

GET = READ
POST = EDIT
PUT = CREATE
DELETE = DELETE

:) This is what REST is all about, that's all I was saying.

For example:
POST to http://server/user/1, edits user with ID 1
DELETE to http://server/user/1, deletes the user with ID 1
PUT to http://server/user (with data :-)) creates a user
GET to http://server/user/1, returns all data of user with ID 1


Maybe, look into docs here:
http://framework.zend.com/manual/en/zend.rest.server.html

It's pretty straight forward, you attach a class with static methods
to the handler and you have a server. That's how Zend does it.
However, I forgot where the discussion about the restful-ness of
Zend_Rest_Server left off, you could easily implement the HTTP verbs
using MVC - that's what I did anyway.

I mean, I am sure you know how to get a basic MVC setup, and all I do
is check what the REQUEST_METHOD is and based on that I call my API
classes.

Till
LightInTheBox - Buy quality products at wholesale price