Glad to help :]

On Nov 14, 4:30 pm, Ashu <[email protected]> wrote:
> AWESOME.
>
> It worked. Yes, the view was not set to the correct action. I did not
> know it had to be done explicitly as it was being taken care for add/
> edit.
>
> Thanks a bunch.
>
> On Nov 14, 3:54 pm, Miles J <[email protected]> wrote:
>
> > View the source of your form and make sure its pointing to the right
> > action, its most likely not since you havent defined it.
>
> > On Nov 14, 1:34 pm, Ashu <[email protected]> wrote:
>
> > >   function beforefilter()
> > > {
> > >     $this->Auth->deny('index', 'manage','add');
>
> > >     //uploader
> > > stuff
> > >     $this->Uploader->uploadDir = 'files/uploads/';
> > >     $this->Uploader->maxFileSize = '2M';
> > >     $this->Uploader->maxNameLength = 25;
> > >     $this->Uploader->mime('image', 'gif', 'image/gif');
> > >   }
>
> > > On Nov 14, 1:03 pm, Miles J <[email protected]> wrote:
>
> > > > So whats in your beforeFilter()? Im assuming your Auth is redirecting
> > > > you.
>
> > > > On Nov 13, 11:59 pm, Ashu <[email protected]> wrote:
>
> > > > > Umm ..... I followed the steps from your link.
>
> > > > > On opening the /bookmarks/uploadI do see the form touploadthe file.
> > > > > After, i select a file (i tried TXT, GIF) and click on submit, it
> > > > > redirects to my index page. And I see no sign of the uploaded file in
> > > > > my app/webroot/files/uploads directory
>
> > > > > Any pointers would be appreciated ......
>
> > > > > #############
>
> > > > > #### bookmarks_controller.php
>
> > > > > class BookmarksController extends AppController {
> > > > >   var $name = 'Bookmarks';
> > > > >   var $components = array('Auth','Uploader.Uploader');
> > > > > ....
> > > > > ....
> > > > >   functionupload() {
> > > > >     if(!empty($this->data)){
> > > > >       if($data = $this->Uploader->upload('fileName')) {
> > > > >         $this->Session->setFlash('Your bookmark has been
> > > > > uploaded');
> > > > >       }
> > > > >     }
> > > > >   }
> > > > > ....
>
> > > > > #### views/bookmarks.upload.ctp
>
> > > > > <?php
> > > > > echo $form->create('Bookmark', array('type' => 'file'));
> > > > > echo $form->input('fileName', array('type' => 'file'));
> > > > > echo $form->end('Upload');
> > > > > ?>
>
> > > > > #### my model looks like this
>
> > > > > <?php
> > > > > class Bookmark extends AppModel {
> > > > >   Var $name = 'Bookmark';
> > > > >   var $belongsTo = array('User');}
>
> > > > > ?>
>
> > > > > #############
>
> > > > > On Nov 12, 9:47 am, Miles J <[email protected]> wrote:
>
> > > > > > No it doesn't have the image data itself, it just gives you a path 
> > > > > > to
> > > > > > where your image was uploaded.
>
> > > > > > On Nov 11, 8:47 pm, Ashu <[email protected]> wrote:
>
> > > > > > > Reading your link I noticed
>
> > > > > > > <quote>
> > > > > > > On a successfulupload, the $data variable will be a populated 
> > > > > > > array
> > > > > > > with the values for the uploaded files filesize, name, extension, 
> > > > > > > mime
> > > > > > > group, destination path,uploadtime and width/height (if an image).
> > > > > > > You can use this data to output text on the frontend, or save 
> > > > > > > data to
> > > > > > > a database.
> > > > > > > </quote>
>
> > > > > > > So, will $data also contain the contents of the File being 
> > > > > > > uploaded,
> > > > > > > so I can start parsing it. Sorry if I am being dense here.
>
> > > > > > > On Nov 9, 3:09 pm, Miles J <[email protected]> wrote:
>
> > > > > > > > You cannot do that if you do theuploadmodel behavior, but you 
> > > > > > > > can
> > > > > > > > manually do it with theuploadcomponent.
>
> > > > > > > > On Nov 9, 2:31 pm, Ashu <[email protected]> wrote:
>
> > > > > > > > > Miles thanks for the link.
>
> > > > > > > > > Will I be able touploada File(Bookmarks.xml) and parse the 
> > > > > > > > > data as
> > > > > > > > > "Title","Url", from the file before I canuploadmy Bookmarks 
> > > > > > > > > Model.
>
> > > > > > > > > On Nov 9, 9:34 am, Miles J <[email protected]> wrote:
>
> > > > > > > > > > My uploader plugin allows you to attach uploads to a model, 
> > > > > > > > > > so its
> > > > > > > > > > automatically done through a behavior.
>
> > > > > > > > > >http://www.milesj.me/resources/script/uploader-plugin#Attaching-Files...
>
> > > > > > > > > > On Nov 9, 9:03 am, Ashu <[email protected]> wrote:
>
> > > > > > > > > > > Hello guys,
>
> > > > > > > > > > > I have a model for Bookmarks, that a user can 
> > > > > > > > > > > add/edit/delete from the
> > > > > > > > > > > web UI. Now, I want to add the functionality to be able 
> > > > > > > > > > > touploada
> > > > > > > > > > > file(bookmarks from FF, Chrome) that is in html format. I 
> > > > > > > > > > > have see a
> > > > > > > > > > > couple of implementations/examples online for uploading a 
> > > > > > > > > > > file.
>
> > > > > > > > > > > In my case, I would like toupload, parse and then 
> > > > > > > > > > > populate my
> > > > > > > > > > > existing Bookmark model. What do you guys suggest ? 
> > > > > > > > > > > Create a new
> > > > > > > > > > >uploadmodel, or ..... i am looking for suggestion ....
>
> > > > > > > > > > > Thanks

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.


Reply via email to