following Michael's sugestion here is what we've come out with.

1. a simple form with a browse button in the template file:

<form action="___URL___" method="post" enctype="multipart/form-data">
<input type="file" name="pictn">
</form>


where ___URL___ is your actions URL

2. Register the global $_FILES in the bootstrap

Zend::register('files',$_FILES);


3. the action in the controller:

$files = Zend::registry('files');

// set the path where the file will be uploaded
$target_path = "uploads/";

// get the filename
$pictureThumbnail = basename( $_FILES['pictn']['name']);

// do the magic
copy($files['pictn']['tmp_name'], $target_path . $pictureThumbnail."");


On 2/22/07, Craig Slusher <[EMAIL PROTECTED]> wrote:

Can you show us some code?

On 2/22/07, Romeo-Adrian Cioaba <[EMAIL PROTECTED]> wrote:
> hey,
>
> following that exact page i have tried to make a simple picture upload
> script but with no success.
>
> can someone point me in the right direction?
>
> thanks!
>
>
> On 2/22/07, Craig Slusher <[EMAIL PROTECTED]> wrote:
> > Section 13.2.4 File Uploads
> >
> http://framework.zend.com/manual/en/zend.http.client.advanced.html
> >
> > On 2/22/07, Romeo-Adrian Cioaba < [EMAIL PROTECTED]> wrote:
> > > i'm trying to figure out how to upload a file through Zend
Framework. If
> > > have tryed with no luck to upload using Zend_Http_Client.
> > >
> > > Can anyone give me a practical example?
> > >
> > > Thank You!
> >
> >
> > --
> > Craig Slusher
> > [EMAIL PROTECTED]
> >
>
>
>
> --
> Romeo-Adrian Cioaba
> Phone: +40724185358
> email: [EMAIL PROTECTED]
>
> Disclaimer
> The information in this e-mail is confidential and may be legally
> privileged. It is intended solely for the addressee.  Access to this
e-mail
> by anyone else is unauthorised.  If you are not the intended recipient
> please do not read, print, re-transmit, store, disclose, copy,
distribute or
> act in reliance on it or any attachments.  Instead please e-mail it back
to
> the sender and then immediately permanently delete it.  By opening any
> attachment to this e-mail you are expressly acknowledging that the
> attachment is subject to copyright, and you thereby undertake not to
alter,
> copy, disseminate, re-transmit, rely upon or use the attachment except
as
> expressly authorised by the sender.


--
Craig Slusher
[EMAIL PROTECTED]




--
Romeo-Adrian Cioaba
Phone: +40724185358
email: [EMAIL PROTECTED]

Disclaimer
The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee.  Access to this e-mail
by anyone else is unauthorised.  If you are not the intended recipient
please do not read, print, re-transmit, store, disclose, copy, distribute or
act in reliance on it or any attachments.  Instead please e-mail it back to
the sender and then immediately permanently delete it.  By opening any
attachment to this e-mail you are expressly acknowledging that the
attachment is subject to copyright, and you thereby undertake not to alter,
copy, disseminate, re-transmit, rely upon or use the attachment except as
expressly authorised by the sender.

Reply via email to