Image file Uploading?
I am having major issues uploading image files. Where is a good tutorial working for cakephp 1.3 that I could look at to see how to upload files to the sever(not database) and how I can turn these images in to thumbnails afterwards? I've tried looking on the bakery and some other places but everything I've used seems to be broken, not what I'm looking for, or outdated. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Excel file uploading and converting to csv
You can export to csv directly from excel. http://vegdave.wordpress.com/2007/05/19/import-a-csv-file-to-mysql-via-phpmyadmin/ On Sep 3, 2:11 pm, Muthuvel Subramani wrote: > hello I am new to cakephp.. i need to import files from excel to mysql > database.. so for this i need to upload the excel file... > after uploading i need to convert excel to csv file.. > after converting to csv, i need to import csv file to mysql.. > how should i approach for this scenario.. > thanks.. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Excel file uploading and converting to csv
hello I am new to cakephp.. i need to import files from excel to mysql database.. so for this i need to upload the excel file... after uploading i need to convert excel to csv file.. after converting to csv, i need to import csv file to mysql.. how should i approach for this scenario.. thanks.. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: file uploading. problems with ajax and jquery
ok i got it.this whole render thing you suggested, dave, helped a lot(!). thank you s muchi just put it into the false function in my controller^^ anyway i appreciate your patience and help very much...all i need to figure out now is, how to do simply nothing if no file is selected..cause right cake is rendering sth too..but i figure that out HGE tHX :) On 1 Aug., 13:07, "Dave Maharaj" wrote: > Well in my case im an in the gallery and adding an image (entry) so add new > image click here, ajax uploads and the image appears. > > You can try > > $this->autoRender = false; in the action, add it as first line of the > function. I do not have it but worth a try. > > Also > > if ($this->RequestHandler->isAjax()) { > > Configure::write('debug', 0); > > } > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: August-01-10 6:54 AM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > how about you? do you have a view for your function manage_add? isnt > cake asking for one? > > On 1 Aug., 01:19, "Dave Maharaj" wrote: > > Ok for my use I have my upload function i stripped out a lot of code as > it's > > just going to make it harder to understand so I just left the save then > > render part. > > > function manage_add( $showcase_id = null ) { > > > //do uploading other stuff what not > > > $white = array('my', 'allowed', 'fields') > > if ($this->Entry->save($this->data, true, $white)) { > > $this->set('entry', > > $this->Entry->getImageInfo($this->data['Entry']['id'], > > $this->Auth->User('id')));//set whatever data you need for the element > here > > $this->render('/elements/entries/new_image', 'ajax'); > //all > > we want to render is this little block of code > > } else { > > > //whatever render error element / message / > > } > > > } > > > new_image.ctp > > //so here I just return the newly uploaded image since that’s all I need > but > > you may may not need more that that > > image('entries/thumb/'.$entry['Entry']['image']); ?> > > > So on your page if you have a target div say in the js response / success > > place that where you want it to go and all you will get is the image. > > > Hope that helps. > > > I started with this method then moved onto JSON / AJAX responses as it > > allowed more flexibility for me but every situation is different so I hope > > it helps. > > I'm no pro so you may get better answers > > > Dave > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 6:44 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > ok this is what i did > > > in my view and specifically in the div, where i want the uploaded > > image to appear (told jquery to put it there in onclick), i included > > this: > > > echo $this->element('previewProfileImage'); > > > this ctp.-file is in views/elements/previewProfileImage.ctp > > > the content of this element is just for testing: (no idea yet how to > > tell in the view: echo $html->image('profilepics/small/'. > > $user['image_path']);) > > echo "bla bla"; > > > it works. but i still get all this other cake crap shown too..like the > > sql and everything else...and not just "bla bla" > > > i'm getting nuts herewhat am i doing wrong? > > > On 31 Jul., 22:45, "Dave Maharaj" wrote: > > > Well for my set up I create an element which simply has the "uploaded > > > image". Use jQuery to get the response and tell it what DIV to place the > > > content in. > > > > -Original Message- > > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > > Sent: July-31-10 3:24 PM > > > To: CakePHP > > > Subject: Re: file uploading. problems with ajax and jquery > > > > dave, thx for the quick reply. i appreciate it. > > > > do you mind going into details a little? you render the div-section? > > > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > > > Render an element containing the image uploaded. > > > > > -Original Message- > > > >
RE: file uploading. problems with ajax and jquery
Well in my case im an in the gallery and adding an image (entry) so add new image click here, ajax uploads and the image appears. You can try $this->autoRender = false; in the action, add it as first line of the function. I do not have it but worth a try. Also if ($this->RequestHandler->isAjax()) { Configure::write('debug', 0); } -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: August-01-10 6:54 AM To: CakePHP Subject: Re: file uploading. problems with ajax and jquery how about you? do you have a view for your function manage_add? isnt cake asking for one? On 1 Aug., 01:19, "Dave Maharaj" wrote: > Ok for my use I have my upload function i stripped out a lot of code as it's > just going to make it harder to understand so I just left the save then > render part. > > function manage_add( $showcase_id = null ) { > > //do uploading other stuff what not > > $white = array('my', 'allowed', 'fields') > if ($this->Entry->save($this->data, true, $white)) { > $this->set('entry', > $this->Entry->getImageInfo($this->data['Entry']['id'], > $this->Auth->User('id')));//set whatever data you need for the element here > $this->render('/elements/entries/new_image', 'ajax'); //all > we want to render is this little block of code > } else { > > //whatever render error element / message / > } > > } > > new_image.ctp > //so here I just return the newly uploaded image since that’s all I need but > you may may not need more that that > image('entries/thumb/'.$entry['Entry']['image']); ?> > > So on your page if you have a target div say in the js response / success > place that where you want it to go and all you will get is the image. > > Hope that helps. > > I started with this method then moved onto JSON / AJAX responses as it > allowed more flexibility for me but every situation is different so I hope > it helps. > I'm no pro so you may get better answers > > Dave > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 6:44 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > ok this is what i did > > in my view and specifically in the div, where i want the uploaded > image to appear (told jquery to put it there in onclick), i included > this: > > echo $this->element('previewProfileImage'); > > this ctp.-file is in views/elements/previewProfileImage.ctp > > the content of this element is just for testing: (no idea yet how to > tell in the view: echo $html->image('profilepics/small/'. > $user['image_path']);) > echo "bla bla"; > > it works. but i still get all this other cake crap shown too..like the > sql and everything else...and not just "bla bla" > > i'm getting nuts herewhat am i doing wrong? > > On 31 Jul., 22:45, "Dave Maharaj" wrote: > > Well for my set up I create an element which simply has the "uploaded > > image". Use jQuery to get the response and tell it what DIV to place the > > content in. > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 3:24 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > dave, thx for the quick reply. i appreciate it. > > > do you mind going into details a little? you render the div-section? > > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > > Render an element containing the image uploaded. > > > > -Original Message- > > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > > Sent: July-31-10 2:54 PM > > > To: CakePHP > > > Subject: Re: file uploading. problems with ajax and jquery > > > > ok i found the problem: > > > > it has to be > > > > > > > not > > > > > > > but i get another one: > > > > i see the "...loading" text for the web 2.0 feeling, BUT: > > > > a) the image wont be uploaded. so i guess my function in controller is > > > not called. and > > > b) because i have > > > $this->redirect(array('controller' => 'users', 'action' => > > > 'editprofile')); > > > in my called function i get to see the whole site in the div, >
Re: file uploading. problems with ajax and jquery
how about you? do you have a view for your function manage_add? isnt cake asking for one? On 1 Aug., 01:19, "Dave Maharaj" wrote: > Ok for my use I have my upload function i stripped out a lot of code as it's > just going to make it harder to understand so I just left the save then > render part. > > function manage_add( $showcase_id = null ) { > > //do uploading other stuff what not > > $white = array('my', 'allowed', 'fields') > if ($this->Entry->save($this->data, true, $white)) { > $this->set('entry', > $this->Entry->getImageInfo($this->data['Entry']['id'], > $this->Auth->User('id')));//set whatever data you need for the element here > $this->render('/elements/entries/new_image', 'ajax'); //all > we want to render is this little block of code > } else { > > //whatever render error element / message / > } > > } > > new_image.ctp > //so here I just return the newly uploaded image since that’s all I need but > you may may not need more that that > image('entries/thumb/'.$entry['Entry']['image']); ?> > > So on your page if you have a target div say in the js response / success > place that where you want it to go and all you will get is the image. > > Hope that helps. > > I started with this method then moved onto JSON / AJAX responses as it > allowed more flexibility for me but every situation is different so I hope > it helps. > I'm no pro so you may get better answers > > Dave > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 6:44 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > ok this is what i did > > in my view and specifically in the div, where i want the uploaded > image to appear (told jquery to put it there in onclick), i included > this: > > echo $this->element('previewProfileImage'); > > this ctp.-file is in views/elements/previewProfileImage.ctp > > the content of this element is just for testing: (no idea yet how to > tell in the view: echo $html->image('profilepics/small/'. > $user['image_path']);) > echo "bla bla"; > > it works. but i still get all this other cake crap shown too..like the > sql and everything else...and not just "bla bla" > > i'm getting nuts herewhat am i doing wrong? > > On 31 Jul., 22:45, "Dave Maharaj" wrote: > > Well for my set up I create an element which simply has the "uploaded > > image". Use jQuery to get the response and tell it what DIV to place the > > content in. > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 3:24 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > dave, thx for the quick reply. i appreciate it. > > > do you mind going into details a little? you render the div-section? > > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > > Render an element containing the image uploaded. > > > > -Original Message- > > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > > Sent: July-31-10 2:54 PM > > > To: CakePHP > > > Subject: Re: file uploading. problems with ajax and jquery > > > > ok i found the problem: > > > > it has to be > > > > > > > not > > > > > > > but i get another one: > > > > i see the "...loading" text for the web 2.0 feeling, BUT: > > > > a) the image wont be uploaded. so i guess my function in controller is > > > not called. and > > > b) because i have > > > $this->redirect(array('controller' => 'users', 'action' => > > > 'editprofile')); > > > in my called function i get to see the whole site in the div, > > > where the uploaded pic should appear. > > > > but if i delete the redirect, cake asks for a view. makes sense > > > though. what do i need to change, that the whole site wont be shown in > > > this div? > > > > thx :) > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google > Groups > > > "Cak
Re: file uploading. problems with ajax and jquery
thx dave...but cake is still asking for a view. thats what i did. in the controller I render the element: -- function uploadProfileImage() { $image_path = $this->Image->upload_image_and_thumbnail($this- >data,"",200,150,$this->Session->read('User.username'), true); $updates = $this->User->findByUsername($this->Session- >read('User.username')); $updates['User']['image_path']= $updates['User']['username']."/". $updates['User']['username'].".jpg"; $this->User->save($updates); $this->render('elements/previewProfileImage', 'ajax'); } my element ctp: -- image('profilepics/small/'.$user['image_path']); ? > and my view where the uploaded image shall appear: -- test what is shown in the target div "uploadProfileImage" is cake asking for the view "uploadProfileImage"i was hoping with render() to solve that problem...or am i missing something here? thx :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: file uploading. problems with ajax and jquery
Ok for my use I have my upload function i stripped out a lot of code as it's just going to make it harder to understand so I just left the save then render part. function manage_add( $showcase_id = null ) { //do uploading other stuff what not $white = array('my', 'allowed', 'fields') if ($this->Entry->save($this->data, true, $white)) { $this->set('entry', $this->Entry->getImageInfo($this->data['Entry']['id'], $this->Auth->User('id')));//set whatever data you need for the element here $this->render('/elements/entries/new_image', 'ajax'); //all we want to render is this little block of code } else { //whatever render error element / message / } } new_image.ctp //so here I just return the newly uploaded image since that’s all I need but you may may not need more that that image('entries/thumb/'.$entry['Entry']['image']); ?> So on your page if you have a target div say in the js response / success place that where you want it to go and all you will get is the image. Hope that helps. I started with this method then moved onto JSON / AJAX responses as it allowed more flexibility for me but every situation is different so I hope it helps. I'm no pro so you may get better answers Dave -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: July-31-10 6:44 PM To: CakePHP Subject: Re: file uploading. problems with ajax and jquery ok this is what i did in my view and specifically in the div, where i want the uploaded image to appear (told jquery to put it there in onclick), i included this: echo $this->element('previewProfileImage'); this ctp.-file is in views/elements/previewProfileImage.ctp the content of this element is just for testing: (no idea yet how to tell in the view: echo $html->image('profilepics/small/'. $user['image_path']);) echo "bla bla"; it works. but i still get all this other cake crap shown too..like the sql and everything else...and not just "bla bla" i'm getting nuts herewhat am i doing wrong? On 31 Jul., 22:45, "Dave Maharaj" wrote: > Well for my set up I create an element which simply has the "uploaded > image". Use jQuery to get the response and tell it what DIV to place the > content in. > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 3:24 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > dave, thx for the quick reply. i appreciate it. > > do you mind going into details a little? you render the div-section? > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > Render an element containing the image uploaded. > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 2:54 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > ok i found the problem: > > > it has to be > > > > > not > > > > > but i get another one: > > > i see the "...loading" text for the web 2.0 feeling, BUT: > > > a) the image wont be uploaded. so i guess my function in controller is > > not called. and > > b) because i have > > $this->redirect(array('controller' => 'users', 'action' => > > 'editprofile')); > > in my called function i get to see the whole site in the div, > > where the uploaded pic should appear. > > > but if i delete the redirect, cake asks for a view. makes sense > > though. what do i need to change, that the whole site wont be shown in > > this div? > > > thx :) > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to
Re: file uploading. problems with ajax and jquery
i appreciate it :) thank you... On 31 Jul., 23:26, "Dave Maharaj" wrote: > Sorry for vague responses. I will show you a better example of my setup > later. > > Dave > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 6:53 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > thx davesorry i'm giving you such a hard time :) > > but where do i need to put this code? in my function > uploadprofileimage that i am calling in my onclick() > > On 31 Jul., 23:15, "Dave Maharaj" wrote: > > In the controller specify $this->render('elements/previewProfileImage'); > so > > it will not try to load anything else > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 6:44 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > ok this is what i did > > > in my view and specifically in the div, where i want the uploaded > > image to appear (told jquery to put it there in onclick), i included > > this: > > > echo $this->element('previewProfileImage'); > > > this ctp.-file is in views/elements/previewProfileImage.ctp > > > the content of this element is just for testing: (no idea yet how to > > tell in the view: echo $html->image('profilepics/small/'. > > $user['image_path']);) > > echo "bla bla"; > > > it works. but i still get all this other cake crap shown too..like the > > sql and everything else...and not just "bla bla" > > > i'm getting nuts herewhat am i doing wrong? > > > On 31 Jul., 22:45, "Dave Maharaj" wrote: > > > Well for my set up I create an element which simply has the "uploaded > > > image". Use jQuery to get the response and tell it what DIV to place the > > > content in. > > > > -Original Message- > > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > > Sent: July-31-10 3:24 PM > > > To: CakePHP > > > Subject: Re: file uploading. problems with ajax and jquery > > > > dave, thx for the quick reply. i appreciate it. > > > > do you mind going into details a little? you render the div-section? > > > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > > > Render an element containing the image uploaded. > > > > > -Original Message- > > > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > > > Sent: July-31-10 2:54 PM > > > > To: CakePHP > > > > Subject: Re: file uploading. problems with ajax and jquery > > > > > ok i found the problem: > > > > > it has to be > > > > > > > > > not > > > > > > > > > but i get another one: > > > > > i see the "...loading" text for the web 2.0 feeling, BUT: > > > > > a) the image wont be uploaded. so i guess my function in controller is > > > > not called. and > > > > b) because i have > > > > $this->redirect(array('controller' => 'users', 'action' => > > > > 'editprofile')); > > > > in my called function i get to see the whole site in the div, > > > > where the uploaded pic should appear. > > > > > but if i delete the redirect, cake asks for a view. makes sense > > > > though. what do i need to change, that the whole site wont be shown in > > > > this div? > > > > > thx :) > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > > with their CakePHP related questions. > > > > > You received this message because you are subscribed to the Google > > Groups > > > > "CakePHP" group. > > > > To post to this group, send email to cake-php@googlegroups.com > > > > To unsubscribe from this group, send email to > > > > cake-php+unsubscr...@googlegroups.com For more options, visit this > group > > > athttp://groups.google.com/group/cake-php?hl=en > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google > Groups > > > "CakePHP" group. > > > To post to this group, send email to cake-php@googlegr
RE: file uploading. problems with ajax and jquery
Sorry for vague responses. I will show you a better example of my setup later. Dave -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: July-31-10 6:53 PM To: CakePHP Subject: Re: file uploading. problems with ajax and jquery thx davesorry i'm giving you such a hard time :) but where do i need to put this code? in my function uploadprofileimage that i am calling in my onclick() On 31 Jul., 23:15, "Dave Maharaj" wrote: > In the controller specify $this->render('elements/previewProfileImage'); so > it will not try to load anything else > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 6:44 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > ok this is what i did > > in my view and specifically in the div, where i want the uploaded > image to appear (told jquery to put it there in onclick), i included > this: > > echo $this->element('previewProfileImage'); > > this ctp.-file is in views/elements/previewProfileImage.ctp > > the content of this element is just for testing: (no idea yet how to > tell in the view: echo $html->image('profilepics/small/'. > $user['image_path']);) > echo "bla bla"; > > it works. but i still get all this other cake crap shown too..like the > sql and everything else...and not just "bla bla" > > i'm getting nuts herewhat am i doing wrong? > > On 31 Jul., 22:45, "Dave Maharaj" wrote: > > Well for my set up I create an element which simply has the "uploaded > > image". Use jQuery to get the response and tell it what DIV to place the > > content in. > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 3:24 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > dave, thx for the quick reply. i appreciate it. > > > do you mind going into details a little? you render the div-section? > > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > > Render an element containing the image uploaded. > > > > -Original Message- > > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > > Sent: July-31-10 2:54 PM > > > To: CakePHP > > > Subject: Re: file uploading. problems with ajax and jquery > > > > ok i found the problem: > > > > it has to be > > > > > > > not > > > > > > > but i get another one: > > > > i see the "...loading" text for the web 2.0 feeling, BUT: > > > > a) the image wont be uploaded. so i guess my function in controller is > > > not called. and > > > b) because i have > > > $this->redirect(array('controller' => 'users', 'action' => > > > 'editprofile')); > > > in my called function i get to see the whole site in the div, > > > where the uploaded pic should appear. > > > > but if i delete the redirect, cake asks for a view. makes sense > > > though. what do i need to change, that the whole site wont be shown in > > > this div? > > > > thx :) > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google > Groups > > > "CakePHP" group. > > > To post to this group, send email to cake-php@googlegroups.com > > > To unsubscribe from this group, send email to > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe f
Re: file uploading. problems with ajax and jquery
thx davesorry i'm giving you such a hard time :) but where do i need to put this code? in my function uploadprofileimage that i am calling in my onclick() On 31 Jul., 23:15, "Dave Maharaj" wrote: > In the controller specify $this->render('elements/previewProfileImage'); so > it will not try to load anything else > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 6:44 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > ok this is what i did > > in my view and specifically in the div, where i want the uploaded > image to appear (told jquery to put it there in onclick), i included > this: > > echo $this->element('previewProfileImage'); > > this ctp.-file is in views/elements/previewProfileImage.ctp > > the content of this element is just for testing: (no idea yet how to > tell in the view: echo $html->image('profilepics/small/'. > $user['image_path']);) > echo "bla bla"; > > it works. but i still get all this other cake crap shown too..like the > sql and everything else...and not just "bla bla" > > i'm getting nuts herewhat am i doing wrong? > > On 31 Jul., 22:45, "Dave Maharaj" wrote: > > Well for my set up I create an element which simply has the "uploaded > > image". Use jQuery to get the response and tell it what DIV to place the > > content in. > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 3:24 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > dave, thx for the quick reply. i appreciate it. > > > do you mind going into details a little? you render the div-section? > > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > > Render an element containing the image uploaded. > > > > -Original Message- > > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > > Sent: July-31-10 2:54 PM > > > To: CakePHP > > > Subject: Re: file uploading. problems with ajax and jquery > > > > ok i found the problem: > > > > it has to be > > > > > > > not > > > > > > > but i get another one: > > > > i see the "...loading" text for the web 2.0 feeling, BUT: > > > > a) the image wont be uploaded. so i guess my function in controller is > > > not called. and > > > b) because i have > > > $this->redirect(array('controller' => 'users', 'action' => > > > 'editprofile')); > > > in my called function i get to see the whole site in the div, > > > where the uploaded pic should appear. > > > > but if i delete the redirect, cake asks for a view. makes sense > > > though. what do i need to change, that the whole site wont be shown in > > > this div? > > > > thx :) > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google > Groups > > > "CakePHP" group. > > > To post to this group, send email to cake-php@googlegroups.com > > > To unsubscribe from this group, send email to > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: file uploading. problems with ajax and jquery
In the controller specify $this->render('elements/previewProfileImage'); so it will not try to load anything else -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: July-31-10 6:44 PM To: CakePHP Subject: Re: file uploading. problems with ajax and jquery ok this is what i did in my view and specifically in the div, where i want the uploaded image to appear (told jquery to put it there in onclick), i included this: echo $this->element('previewProfileImage'); this ctp.-file is in views/elements/previewProfileImage.ctp the content of this element is just for testing: (no idea yet how to tell in the view: echo $html->image('profilepics/small/'. $user['image_path']);) echo "bla bla"; it works. but i still get all this other cake crap shown too..like the sql and everything else...and not just "bla bla" i'm getting nuts herewhat am i doing wrong? On 31 Jul., 22:45, "Dave Maharaj" wrote: > Well for my set up I create an element which simply has the "uploaded > image". Use jQuery to get the response and tell it what DIV to place the > content in. > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 3:24 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > dave, thx for the quick reply. i appreciate it. > > do you mind going into details a little? you render the div-section? > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > Render an element containing the image uploaded. > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 2:54 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > ok i found the problem: > > > it has to be > > > > > not > > > > > but i get another one: > > > i see the "...loading" text for the web 2.0 feeling, BUT: > > > a) the image wont be uploaded. so i guess my function in controller is > > not called. and > > b) because i have > > $this->redirect(array('controller' => 'users', 'action' => > > 'editprofile')); > > in my called function i get to see the whole site in the div, > > where the uploaded pic should appear. > > > but if i delete the redirect, cake asks for a view. makes sense > > though. what do i need to change, that the whole site wont be shown in > > this div? > > > thx :) > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: file uploading. problems with ajax and jquery
ok this is what i did in my view and specifically in the div, where i want the uploaded image to appear (told jquery to put it there in onclick), i included this: echo $this->element('previewProfileImage'); this ctp.-file is in views/elements/previewProfileImage.ctp the content of this element is just for testing: (no idea yet how to tell in the view: echo $html->image('profilepics/small/'. $user['image_path']);) echo "bla bla"; it works. but i still get all this other cake crap shown too..like the sql and everything else...and not just "bla bla" i'm getting nuts herewhat am i doing wrong? On 31 Jul., 22:45, "Dave Maharaj" wrote: > Well for my set up I create an element which simply has the "uploaded > image". Use jQuery to get the response and tell it what DIV to place the > content in. > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 3:24 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > dave, thx for the quick reply. i appreciate it. > > do you mind going into details a little? you render the div-section? > > On 31 Jul., 19:28, "Dave Maharaj" wrote: > > Render an element containing the image uploaded. > > > -----Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: July-31-10 2:54 PM > > To: CakePHP > > Subject: Re: file uploading. problems with ajax and jquery > > > ok i found the problem: > > > it has to be > > > > > not > > > > > but i get another one: > > > i see the "...loading" text for the web 2.0 feeling, BUT: > > > a) the image wont be uploaded. so i guess my function in controller is > > not called. and > > b) because i have > > $this->redirect(array('controller' => 'users', 'action' => > > 'editprofile')); > > in my called function i get to see the whole site in the div, > > where the uploaded pic should appear. > > > but if i delete the redirect, cake asks for a view. makes sense > > though. what do i need to change, that the whole site wont be shown in > > this div? > > > thx :) > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: file uploading. problems with ajax and jquery
Well for my set up I create an element which simply has the "uploaded image". Use jQuery to get the response and tell it what DIV to place the content in. -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: July-31-10 3:24 PM To: CakePHP Subject: Re: file uploading. problems with ajax and jquery dave, thx for the quick reply. i appreciate it. do you mind going into details a little? you render the div-section? On 31 Jul., 19:28, "Dave Maharaj" wrote: > Render an element containing the image uploaded. > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 2:54 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > ok i found the problem: > > it has to be > > > not > > > but i get another one: > > i see the "...loading" text for the web 2.0 feeling, BUT: > > a) the image wont be uploaded. so i guess my function in controller is > not called. and > b) because i have > $this->redirect(array('controller' => 'users', 'action' => > 'editprofile')); > in my called function i get to see the whole site in the div, > where the uploaded pic should appear. > > but if i delete the redirect, cake asks for a view. makes sense > though. what do i need to change, that the whole site wont be shown in > this div? > > thx :) > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: file uploading. problems with ajax and jquery
dave, thx for the quick reply. i appreciate it. do you mind going into details a little? you render the div-section? On 31 Jul., 19:28, "Dave Maharaj" wrote: > Render an element containing the image uploaded. > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: July-31-10 2:54 PM > To: CakePHP > Subject: Re: file uploading. problems with ajax and jquery > > ok i found the problem: > > it has to be > > > not > > > but i get another one: > > i see the "...loading" text for the web 2.0 feeling, BUT: > > a) the image wont be uploaded. so i guess my function in controller is > not called. and > b) because i have > $this->redirect(array('controller' => 'users', 'action' => > 'editprofile')); > in my called function i get to see the whole site in the div, > where the uploaded pic should appear. > > but if i delete the redirect, cake asks for a view. makes sense > though. what do i need to change, that the whole site wont be shown in > this div? > > thx :) > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: file uploading. problems with ajax and jquery
Render an element containing the image uploaded. -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: July-31-10 2:54 PM To: CakePHP Subject: Re: file uploading. problems with ajax and jquery ok i found the problem: it has to be not but i get another one: i see the "...loading" text for the web 2.0 feeling, BUT: a) the image wont be uploaded. so i guess my function in controller is not called. and b) because i have $this->redirect(array('controller' => 'users', 'action' => 'editprofile')); in my called function i get to see the whole site in the div, where the uploaded pic should appear. but if i delete the redirect, cake asks for a view. makes sense though. what do i need to change, that the whole site wont be shown in this div? thx :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: file uploading. problems with ajax and jquery
ok i found the problem: it has to be not but i get another one: i see the "...loading" text for the web 2.0 feeling, BUT: a) the image wont be uploaded. so i guess my function in controller is not called. and b) because i have $this->redirect(array('controller' => 'users', 'action' => 'editprofile')); in my called function i get to see the whole site in the div, where the uploaded pic should appear. but if i delete the redirect, cake asks for a view. makes sense though. what do i need to change, that the whole site wont be shown in this div? thx :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: File Uploading
¿Did you put the attribute enctype="multipart/form-data" in the form? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Uploading
Ah, thought it looked strange. Haven't looked at that variable since 2006 probably :) On Mar 12, 9:58 am, AD7six wrote: > On Mar 12, 9:43 am, Martin Westin wrote: > > > I, for one, would have expected something more like what is shown > > here:http://book.cakephp.org/view/303/File-Fields > > Yes but you're looking at $this->data and manisha isn't (http:// > es2.php.net/manual/en/features.file-upload.multiple.php#53240) > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Uploading
while uploading files u have to create form like create('Author',array('name'=>'AddAuthor','type'=>'file','url'=>array('controller'=>'authors','action'=>'admin_add'))); ?> 'type'=>'file' is important for uploading files. On Thu, Mar 12, 2009 at 11:38 AM, manisha wrote: > > Hello, > > I am a new user for cakePHP and I am using $form->file > ('UserInfo.company_logo', array('size' => 40)); for uploading an > image, but after post, I am getting array like > > Array > ( >[data] => Array >( >[name] => Array >( >[UserInfo] => Array >( >[company_logo] => >[user_photo] => >) >) >[type] => Array >( >[UserInfo] => Array >( >[company_logo] => >[user_photo] => >) >) > >[tmp_name] => Array >( >[UserInfo] => Array >( >[company_logo] => >[user_photo] => >) > >) >[error] => Array >( >[UserInfo] => Array >( >[company_logo] => 4 >[user_photo] => 4 >) > >) > >[size] => Array >( >[UserInfo] => Array >( >[company_logo] => 0 >[user_photo] => 0 >) > >) > >) > > ) > > > Does anyone has some idea about how to upload an image with cakePHP? > > > > -- Regards, Gayatri, IT Associate, IEG, Hyderabad. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Uploading
On Mar 12, 9:43 am, Martin Westin wrote: > I, for one, would have expected something more like what is shown > here:http://book.cakephp.org/view/303/File-Fields Yes but you're looking at $this->data and manisha isn't (http:// es2.php.net/manual/en/features.file-upload.multiple.php#53240) AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Uploading
I, for one, would have expected something more like what is shown here: http://book.cakephp.org/view/303/File-Fields You didn't forget to make the form an upload form? $form->create('UserInfo', array('type' => 'file')); On Mar 12, 9:14 am, AD7six wrote: > On Mar 12, 7:08 am, manisha wrote: > > > > > Hello, > > > I am a new user for cakePHP and I am using $form->file > > ('UserInfo.company_logo', array('size' => 40)); for uploading an > > image, but after post, I am getting array like > > > Array > > ( > > [data] => Array > > ( > > [name] => Array > > ( > > [UserInfo] => Array > > ( > > [company_logo] => > > [user_photo] => > > ) > > ) > > [type] => Array > > ( > > [UserInfo] => Array > > ( > > [company_logo] => > > [user_photo] => > > ) > > ) > > > [tmp_name] => Array > > ( > > [UserInfo] => Array > > ( > > [company_logo] => > > [user_photo] => > > ) > > > ) > > [error] => Array > > ( > > [UserInfo] => Array > > ( > > [company_logo] => 4 > > [user_photo] => 4 > > ) > > > ) > > > [size] => Array > > ( > > [UserInfo] => Array > > ( > > [company_logo] => 0 > > [user_photo] => 0 > > ) > > > ) > > > ) > > > ) > > > Does anyone has some idea about how to upload an image with cakePHP? > > In what way, if you're going to refer to $_POST instead of $this->data > (hint), is that format a surprise? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Uploading
On Mar 12, 7:08 am, manisha wrote: > Hello, > > I am a new user for cakePHP and I am using $form->file > ('UserInfo.company_logo', array('size' => 40)); for uploading an > image, but after post, I am getting array like > > Array > ( > [data] => Array > ( > [name] => Array > ( > [UserInfo] => Array > ( > [company_logo] => > [user_photo] => > ) > ) > [type] => Array > ( > [UserInfo] => Array > ( > [company_logo] => > [user_photo] => > ) > ) > > [tmp_name] => Array > ( > [UserInfo] => Array > ( > [company_logo] => > [user_photo] => > ) > > ) > [error] => Array > ( > [UserInfo] => Array > ( > [company_logo] => 4 > [user_photo] => 4 > ) > > ) > > [size] => Array > ( > [UserInfo] => Array > ( > [company_logo] => 0 > [user_photo] => 0 > ) > > ) > > ) > > ) > > Does anyone has some idea about how to upload an image with cakePHP? In what way, if you're going to refer to $_POST instead of $this->data (hint), is that format a surprise? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
File Uploading
Hello, I am a new user for cakePHP and I am using $form->file ('UserInfo.company_logo', array('size' => 40)); for uploading an image, but after post, I am getting array like Array ( [data] => Array ( [name] => Array ( [UserInfo] => Array ( [company_logo] => [user_photo] => ) ) [type] => Array ( [UserInfo] => Array ( [company_logo] => [user_photo] => ) ) [tmp_name] => Array ( [UserInfo] => Array ( [company_logo] => [user_photo] => ) ) [error] => Array ( [UserInfo] => Array ( [company_logo] => 4 [user_photo] => 4 ) ) [size] => Array ( [UserInfo] => Array ( [company_logo] => 0 [user_photo] => 0 ) ) ) ) Does anyone has some idea about how to upload an image with cakePHP? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file uploading in cake php
http://www.meiocodigo.com/projects/meioupload/ On Sun, Dec 28, 2008 at 12:40 PM, mona wrote: > > > I tried alot but it is not working any other options > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file uploading in cake php
http://bin.cakephp.org/saved/23715 On Dec 28, 6:40 pm, mona wrote: > I tried alot but it is not working any other options --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file uploading in cake php
I tried alot but it is not working any other options --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file uploading in cake php
Google "upload files with CakePHP" On Dec 27, 8:59 am, mona wrote: > Hello mike > sorry for distutbing you once again. I am sending you my file > uploading problem please i need your help if you help me it will be > great help for me > this is my add view code please consider it > New Entry > create('Entry',array('action' => 'add','type' => > 'file'));?> > > input('Section', array('options' => array > ('Announcements','The Venue','About Melbourne')),array('error' => > 'false','value' => array(1,2,3) )); ?> > > > input('Submenu', array('options' => array > (1,2,3,4,5)),array('error' => false,'label' => 'Submenu')); ?> > > > input('Listitem',array('label' => 'Listitem'),array > ('error' => false));?> > > > input('Detail',array('label' => 'Detail'),array > ('error' => false));?> > > > file('File'); ?> > > > submit('Add');?> > > > > link('Home', '/entries/index')?> > > > from this form i wan't to upload file when I click on submit button > where to write file upload code please correct my code > this is my controller code > class EntriesController extends AppController { > > var $name = 'Entries'; > var $helpers = array('Html','Form'); > > function index() > { > > $this->Entry->recursive = 1; > $this->set('entries', $this->Entry->findAll()); > > } > function view($id = null) > { > if (!$id) > { > $this->Session->setFlash('Invalid id for Entry.'); > $this->redirect('/entries/index'); > } > $this->set('entry', $this->Entry->read(null, $id)); > > } > > function add() > { > if (empty($this->data)) > { > $this->render(); > } > else > { > //$this->cleanUpFields(); > > if ($this->Entry->save($this->data)) > { > > $this->Session->setFlash('The Entry > has been saved'); > $this->redirect('/entries/index'); > } > else > { > $this->Session->setFlash('Please > correct errors below.'); > } > } > } > function edit($id = null) > { > if (empty($this->data)) > { > if (!$id) > { > $this->Session->setFlash('Invalid id for > Entry'); > $this->redirect('/entries/index'); > } > $this->data = $this->Entry->read(null, $id); > } else > { > //$this->cleanUpFields(); > if ($this->Entry->save($this->data)) > { > $this->Session->setFlash('The Entry > has been saved'); > $this->redirect('/entries/index'); > } > else > { > $this->Session->setFlash('Please > correct errors below.'); > } > } > } > function delete($id = null) { > if (!$id) { > $this->Session->setFlash('Invalid id for Entry'); > $this->redirect('/entries/index'); > } > if ($this->Entry->del($id)) { > $this->Session->setFlash('Record deleted > successfully'); > $this->redirect('/entries/index'); > } > } > > } > > ?> > how to upload files from this code --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file uploading in cake php
Hello mike sorry for distutbing you once again. I am sending you my file uploading problem please i need your help if you help me it will be great help for me this is my add view code please consider it New Entry create('Entry',array('action' => 'add','type' => 'file'));?> input('Section', array('options' => array ('Announcements','The Venue','About Melbourne')),array('error' => 'false','value' => array(1,2,3) )); ?> input('Submenu', array('options' => array (1,2,3,4,5)),array('error' => false,'label' => 'Submenu')); ?> input('Listitem',array('label' => 'Listitem'),array ('error' => false));?> input('Detail',array('label' => 'Detail'),array ('error' => false));?> file('File'); ?> submit('Add');?> link('Home', '/entries/index')?> from this form i wan't to upload file when I click on submit button where to write file upload code please correct my code this is my controller code Entry->recursive = 1; $this->set('entries', $this->Entry->findAll()); } function view($id = null) { if (!$id) { $this->Session->setFlash('Invalid id for Entry.'); $this->redirect('/entries/index'); } $this->set('entry', $this->Entry->read(null, $id)); } function add() { if (empty($this->data)) { $this->render(); } else { //$this->cleanUpFields(); if ($this->Entry->save($this->data)) { $this->Session->setFlash('The Entry has been saved'); $this->redirect('/entries/index'); } else { $this->Session->setFlash('Please correct errors below.'); } } } function edit($id = null) { if (empty($this->data)) { if (!$id) { $this->Session->setFlash('Invalid id for Entry'); $this->redirect('/entries/index'); } $this->data = $this->Entry->read(null, $id); } else { //$this->cleanUpFields(); if ($this->Entry->save($this->data)) { $this->Session->setFlash('The Entry has been saved'); $this->redirect('/entries/index'); } else { $this->Session->setFlash('Please correct errors below.'); } } } function delete($id = null) { if (!$id) { $this->Session->setFlash('Invalid id for Entry'); $this->redirect('/entries/index'); } if ($this->Entry->del($id)) { $this->Session->setFlash('Record deleted successfully'); $this->redirect('/entries/index'); } } } ?> how to upload files from this code --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file uploading in cake php
I'd like to help, but It's way too late for me to be reading that bad of a run-on sentence. Could you try rephrasing the question with some punctuation? On Dec 26, 10:04 pm, mona wrote: > thanks for the reply but when i click on add button to submit the form > value in the database it is displaying the error like array to string > conversion something like that how to print the value of array you me > the above link but in all that page file uploading having different > table different controller so can i make new table for file uploading > and but i want to store file data in my main table enteries how can i > do that --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file uploading in cake php
thanks for the reply but when i click on add button to submit the form value in the database it is displaying the error like array to string conversion something like that how to print the value of array you me the above link but in all that page file uploading having different table different controller so can i make new table for file uploading and but i want to store file data in my main table enteries how can i do that --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: file uploading in cake php
Have you tried printing the array to see what it contains? The array holds everything that $_FILE[] normally would. Use these values to upload your file, then set the variable to the name of the file or whatever you want inserted into the database. Cake does not have an automagic way to handle file uploads, it takes a couple of lines in the controller to take care of this. Google cakephp file upload for more examples. http://letmegooglethatforyou.com/?q=cakephp+file+upload On Dec 26, 11:50 am, mona wrote: > In my add view i have one form which contain file upload option i want > to send all the values of form in one table but file upload option is > displaying error like array to string conversion because the query is > like that ("insert into enteries(section,list,submenu,file) values > ('shopping','list','sub',array)") why file field is having array as a > value how to do file uploading from a form in cakephp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
file uploading in cake php
In my add view i have one form which contain file upload option i want to send all the values of form in one table but file upload option is displaying error like array to string conversion because the query is like that ("insert into enteries(section,list,submenu,file) values ('shopping','list','sub',array)") why file field is having array as a value how to do file uploading from a form in cakephp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Uploading problem
Can I change anything in phpmyadmin so that I can upload larger files? because my database can not upload any file that is more than 999kb. Thanks Damelinks On 10/21/08, Donkeybob <[EMAIL PROTECTED]> wrote: > > I've gotten this to work. haha . . .it was a php.ini setting of the > file upload variables that was uploaded to the wrong place and also a > x-m4a media type validation. . . .thanks for everybody's help. > > On Oct 21, 11:37 am, [EMAIL PROTECTED] wrote: >> If you are using iis in windows server 2003, the default upload size is >> 200kb. >> This can be changed in IIS and also edit the metabase.xml file. >> >> Sent from my Verizon Wireless BlackBerry >> >> -Original Message- >> From: LunarDraco <[EMAIL PROTECTED]> >> >> Date: Tue, 21 Oct 2008 08:29:15 >> To: CakePHP >> Subject: Re: File Uploading problem >> >> The file size for most http post is limited by the server and php to >> something less than 2048. Which limits your capabilities of the size >> of file you can upload. >> In order to upload files larger than this limit you would need to >> chunk the file and then reassemble the file on the server. >> >> This usually requires some kind of client side java applet, that can >> break the file into pieces and send the pieces as individual posts. >> An example of this ishttp://www.jumploader.com/, there are many more >> paid and free large file upload applets, and flash components. >> >> I choose jumploader for my project because it runs on all three >> platforms that I intend to support. And if I really don't like >> something I have the option of buying the source. >> >> Do some searching for large file upload applet you'll find what you >> need to get past your current problem. >> >> On Oct 20, 2:21 pm, Donkeybob <[EMAIL PROTECTED]> wrote: >> > The file size is 7 mb >> >> > my php.ini settings: >> > max_execution_time = 30 >> > max_input_time = 60 >> > memory_limit = 32M >> > post_max_size = 75M >> > upload_max_filesize = 50M >> >> > I post it to the database too. The area where it errors, is when it >> > saves the data because $this->data does not have filename, mediatype >> > and size included. >> >> > On Oct 20, 3:35 pm, Julien Buratto <[EMAIL PROTECTED]> wrote: >> >> > > Donkeybob wrote: >> > > > I'm using this: $form->file('filename') in my file upload utilty. >> > > > Some >> > > > certain files will upload and save the data, but some files types >> > > > don't. . . . . .ex. podcast.m4a. >> >> > > > When i submit the form . . .this->data only posts: >> > > > Array >> > > > ( >> > > > [Fileupload] => Array >> > > > ( >> > > > [name] => Podcast name >> > > > [type] => Podcast >> > > > [filename] => >> > > > [mediatype] => >> > > > [size] => 0 >> > > > [path] => >> > > > ) >> >> > > > ) >> >> > > > Why would it not read the file details? I can upload other files . . >> > > > . >> >> > > > thanks >> > > > Rich >> >> > > Size? did you check the php.ini file ? are you writing to db ? if so, >> > > which is the max query size you are allowed to execute ? >> >> > > J > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File Uploading problem
I've gotten this to work. haha . . .it was a php.ini setting of the file upload variables that was uploaded to the wrong place and also a x-m4a media type validation. . . .thanks for everybody's help. On Oct 21, 11:37 am, [EMAIL PROTECTED] wrote: > If you are using iis in windows server 2003, the default upload size is 200kb. > This can be changed in IIS and also edit the metabase.xml file. > > Sent from my Verizon Wireless BlackBerry > > -Original Message- > From: LunarDraco <[EMAIL PROTECTED]> > > Date: Tue, 21 Oct 2008 08:29:15 > To: CakePHP > Subject: Re: File Uploading problem > > The file size for most http post is limited by the server and php to > something less than 2048. Which limits your capabilities of the size > of file you can upload. > In order to upload files larger than this limit you would need to > chunk the file and then reassemble the file on the server. > > This usually requires some kind of client side java applet, that can > break the file into pieces and send the pieces as individual posts. > An example of this ishttp://www.jumploader.com/, there are many more > paid and free large file upload applets, and flash components. > > I choose jumploader for my project because it runs on all three > platforms that I intend to support. And if I really don't like > something I have the option of buying the source. > > Do some searching for large file upload applet you'll find what you > need to get past your current problem. > > On Oct 20, 2:21 pm, Donkeybob <[EMAIL PROTECTED]> wrote: > > The file size is 7 mb > > > my php.ini settings: > > max_execution_time = 30 > > max_input_time = 60 > > memory_limit = 32M > > post_max_size = 75M > > upload_max_filesize = 50M > > > I post it to the database too. The area where it errors, is when it > > saves the data because $this->data does not have filename, mediatype > > and size included. > > > On Oct 20, 3:35 pm, Julien Buratto <[EMAIL PROTECTED]> wrote: > > > > Donkeybob wrote: > > > > I'm using this: $form->file('filename') in my file upload utilty. Some > > > > certain files will upload and save the data, but some files types > > > > don't. . . . . .ex. podcast.m4a. > > > > > When i submit the form . . .this->data only posts: > > > > Array > > > > ( > > > > [Fileupload] => Array > > > > ( > > > > [name] => Podcast name > > > > [type] => Podcast > > > > [filename] => > > > > [mediatype] => > > > > [size] => 0 > > > > [path] => > > > > ) > > > > > ) > > > > > Why would it not read the file details? I can upload other files . . . > > > > > thanks > > > > Rich > > > > Size? did you check the php.ini file ? are you writing to db ? if so, > > > which is the max query size you are allowed to execute ? > > > > J --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File Uploading problem
If you are using iis in windows server 2003, the default upload size is 200kb. This can be changed in IIS and also edit the metabase.xml file. Sent from my Verizon Wireless BlackBerry -Original Message- From: LunarDraco <[EMAIL PROTECTED]> Date: Tue, 21 Oct 2008 08:29:15 To: CakePHP Subject: Re: File Uploading problem The file size for most http post is limited by the server and php to something less than 2048. Which limits your capabilities of the size of file you can upload. In order to upload files larger than this limit you would need to chunk the file and then reassemble the file on the server. This usually requires some kind of client side java applet, that can break the file into pieces and send the pieces as individual posts. An example of this is http://www.jumploader.com/, there are many more paid and free large file upload applets, and flash components. I choose jumploader for my project because it runs on all three platforms that I intend to support. And if I really don't like something I have the option of buying the source. Do some searching for large file upload applet you'll find what you need to get past your current problem. On Oct 20, 2:21 pm, Donkeybob <[EMAIL PROTECTED]> wrote: > The file size is 7 mb > > my php.ini settings: > max_execution_time = 30 > max_input_time = 60 > memory_limit = 32M > post_max_size = 75M > upload_max_filesize = 50M > > I post it to the database too. The area where it errors, is when it > saves the data because $this->data does not have filename, mediatype > and size included. > > On Oct 20, 3:35 pm, Julien Buratto <[EMAIL PROTECTED]> wrote: > > > Donkeybob wrote: > > > I'm using this: $form->file('filename') in my file upload utilty. Some > > > certain files will upload and save the data, but some files types > > > don't. . . . . .ex. podcast.m4a. > > > > When i submit the form . . .this->data only posts: > > > Array > > > ( > > > [Fileupload] => Array > > > ( > > > [name] => Podcast name > > > [type] => Podcast > > > [filename] => > > > [mediatype] => > > > [size] => 0 > > > [path] => > > > ) > > > > ) > > > > Why would it not read the file details? I can upload other files . . . > > > > thanks > > > Rich > > > Size? did you check the php.ini file ? are you writing to db ? if so, > > which is the max query size you are allowed to execute ? > > > J --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File Uploading problem
The file size for most http post is limited by the server and php to something less than 2048. Which limits your capabilities of the size of file you can upload. In order to upload files larger than this limit you would need to chunk the file and then reassemble the file on the server. This usually requires some kind of client side java applet, that can break the file into pieces and send the pieces as individual posts. An example of this is http://www.jumploader.com/, there are many more paid and free large file upload applets, and flash components. I choose jumploader for my project because it runs on all three platforms that I intend to support. And if I really don't like something I have the option of buying the source. Do some searching for large file upload applet you'll find what you need to get past your current problem. On Oct 20, 2:21 pm, Donkeybob <[EMAIL PROTECTED]> wrote: > The file size is 7 mb > > my php.ini settings: > max_execution_time = 30 > max_input_time = 60 > memory_limit = 32M > post_max_size = 75M > upload_max_filesize = 50M > > I post it to the database too. The area where it errors, is when it > saves the data because $this->data does not have filename, mediatype > and size included. > > On Oct 20, 3:35 pm, Julien Buratto <[EMAIL PROTECTED]> wrote: > > > Donkeybob wrote: > > > I'm using this: $form->file('filename') in my file upload utilty. Some > > > certain files will upload and save the data, but some files types > > > don't. . . . . .ex. podcast.m4a. > > > > When i submit the form . . .this->data only posts: > > > Array > > > ( > > > [Fileupload] => Array > > > ( > > > [name] => Podcast name > > > [type] => Podcast > > > [filename] => > > > [mediatype] => > > > [size] => 0 > > > [path] => > > > ) > > > > ) > > > > Why would it not read the file details? I can upload other files . . . > > > > thanks > > > Rich > > > Size? did you check the php.ini file ? are you writing to db ? if so, > > which is the max query size you are allowed to execute ? > > > J --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File Uploading problem
Did you include 'type' => 'file' in the form create method? On Oct 20, 10:17 pm, "Lee Reynolds" <[EMAIL PROTECTED]> wrote: > The only time I've had this issue was when I was exceeding the file > upload limit. > > You can change it in php.ini. Not sure if you need to restart apache > after a change there or not for it to take effect. > > Lee > > On Mon, Oct 20, 2008 at 11:01 AM, Donkeybob <[EMAIL PROTECTED]> wrote: > > > I'm using this: $form->file('filename') in my file upload utilty. Some > > certain files will upload and save the data, but some files types > > don't. . . . . .ex. podcast.m4a. > > > When i submit the form . . .this->data only posts: > > Array > > ( > > [Fileupload] => Array > > ( > > [name] => Podcast name > > [type] => Podcast > > [filename] => > > [mediatype] => > > [size] => 0 > > [path] => > > ) > > > ) > > > Why would it not read the file details? I can upload other files . . . > > > thanks > > Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File Uploading problem
The only time I've had this issue was when I was exceeding the file upload limit. You can change it in php.ini. Not sure if you need to restart apache after a change there or not for it to take effect. Lee On Mon, Oct 20, 2008 at 11:01 AM, Donkeybob <[EMAIL PROTECTED]> wrote: > > I'm using this: $form->file('filename') in my file upload utilty. Some > certain files will upload and save the data, but some files types > don't. . . . . .ex. podcast.m4a. > > When i submit the form . . .this->data only posts: > Array > ( >[Fileupload] => Array >( >[name] => Podcast name >[type] => Podcast >[filename] => >[mediatype] => >[size] => 0 >[path] => >) > > ) > > Why would it not read the file details? I can upload other files . . . > > thanks > Rich > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File Uploading problem
It may have to do with your form tag missing some attributes. See: http://cgi-lib.berkeley.edu/ex/fup.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File Uploading problem
The file size is 7 mb my php.ini settings: max_execution_time = 30 max_input_time = 60 memory_limit = 32M post_max_size = 75M upload_max_filesize = 50M I post it to the database too. The area where it errors, is when it saves the data because $this->data does not have filename, mediatype and size included. On Oct 20, 3:35 pm, Julien Buratto <[EMAIL PROTECTED]> wrote: > Donkeybob wrote: > > I'm using this: $form->file('filename') in my file upload utilty. Some > > certain files will upload and save the data, but some files types > > don't. . . . . .ex. podcast.m4a. > > > When i submit the form . . .this->data only posts: > > Array > > ( > > [Fileupload] => Array > > ( > > [name] => Podcast name > > [type] => Podcast > > [filename] => > > [mediatype] => > > [size] => 0 > > [path] => > > ) > > > ) > > > Why would it not read the file details? I can upload other files . . . > > > thanks > > Rich > > Size? did you check the php.ini file ? are you writing to db ? if so, > which is the max query size you are allowed to execute ? > > J --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File Uploading problem
Donkeybob wrote: > I'm using this: $form->file('filename') in my file upload utilty. Some > certain files will upload and save the data, but some files types > don't. . . . . .ex. podcast.m4a. > > When i submit the form . . .this->data only posts: > Array > ( > [Fileupload] => Array > ( > [name] => Podcast name > [type] => Podcast > [filename] => > [mediatype] => > [size] => 0 > [path] => > ) > > ) > > Why would it not read the file details? I can upload other files . . . > > thanks > Rich > > Size? did you check the php.ini file ? are you writing to db ? if so, which is the max query size you are allowed to execute ? J --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
File Uploading problem
I'm using this: $form->file('filename') in my file upload utilty. Some certain files will upload and save the data, but some files types don't. . . . . .ex. podcast.m4a. When i submit the form . . .this->data only posts: Array ( [Fileupload] => Array ( [name] => Podcast name [type] => Podcast [filename] => [mediatype] => [size] => 0 [path] => ) ) Why would it not read the file details? I can upload other files . . . thanks Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File uploading in cake
You could use the image behavior http://bakery.cakephp.org/articles/view/actas-image-column-behavior 2008/7/16 kaushik <[EMAIL PROTECTED]>: > > I am new in CakePHP. I want to store the products and product details > with image (image will be store in folder, not in table). > > Here is my code details: > categories Table: > > `categoryId` int(10) NOT NULL auto_increment, > `categoryName` varchar(100) NOT NULL, > `isActive` enum('Y','N') NOT NULL default 'Y', > PRIMARY KEY (`categoryId`) > > products Table: > > `productId` int(10) NOT NULL auto_increment, > `productName` varchar(20) NOT NULL, > `categoryId` int(10) NOT NULL, > `productImage` varchar(40) NOT NULL, > `isActive` enum('Y','N') NOT NULL default 'Y', > PRIMARY KEY (`productId`) > > It is my product Model > > class product extends AppModel > { > var $name = 'Product'; > var $primaryKey = 'productId'; > var $validate = array( > 'productName' => VALID_NOT_EMPTY, > ); > > var $belongsTo = array( >'Category' => array( >'className' => 'category', >'foreignKey' => 'categoryId', >) >); > > } > > and it is my category model: > > class category extends AppModel > { > var $name = 'Category'; > var $primaryKey = 'categoryId'; > var $validate = array( > 'categoryName' => VALID_NOT_EMPTY, > ); > > } > > Product Controller: > > function admin_add() > { > if (!empty($this->data['Product'])) > { >if ($this->Product->save($this->data)) > $this->flash('Your Product has been added.','../products/', > 5); > } > > } > > I want to introduce the image upload functionality with it. I have > gone thu a few articles on cakephp upload file, become more confused. > Is there any easy way to do it? Is there any in-built helper for this > type of functionality? Please help me. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
File uploading in cake
I am new in CakePHP. I want to store the products and product details with image (image will be store in folder, not in table). Here is my code details: categories Table: `categoryId` int(10) NOT NULL auto_increment, `categoryName` varchar(100) NOT NULL, `isActive` enum('Y','N') NOT NULL default 'Y', PRIMARY KEY (`categoryId`) products Table: `productId` int(10) NOT NULL auto_increment, `productName` varchar(20) NOT NULL, `categoryId` int(10) NOT NULL, `productImage` varchar(40) NOT NULL, `isActive` enum('Y','N') NOT NULL default 'Y', PRIMARY KEY (`productId`) It is my product Model class product extends AppModel { var $name = 'Product'; var $primaryKey = 'productId'; var $validate = array( 'productName' => VALID_NOT_EMPTY, ); var $belongsTo = array( 'Category' => array( 'className' => 'category', 'foreignKey' => 'categoryId', ) ); } and it is my category model: class category extends AppModel { var $name = 'Category'; var $primaryKey = 'categoryId'; var $validate = array( 'categoryName' => VALID_NOT_EMPTY, ); } Product Controller: function admin_add() { if (!empty($this->data['Product'])) { if ($this->Product->save($this->data)) $this->flash('Your Product has been added.','../products/', 5); } } I want to introduce the image upload functionality with it. I have gone thu a few articles on cakephp upload file, become more confused. Is there any easy way to do it? Is there any in-built helper for this type of functionality? Please help me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
simple file uploading (1.2 alpha)
hi, I need to upload files into the "files" dir in webroot I saw a few scripts but they are often too complicated for my needs : using a Model or saving files into DB in my case, files are not related with any model is there a very simple way to code it ? should I use the basic file upload php script without using Cake's functions ? thanks for helping --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: File uploading using 1
Have you declaredvar $actsAs = array('Upload' => array(__OPTIONS_HERE__) ); in the model? Have you put the UploadBehaviour in app/models/behaviours/ upload.php ? Please paste your model. On Oct 19, 7:08 am, Indian Baker <[EMAIL PROTECTED]> wrote: > Hi, > I'm referring to the following excellent link to try and do a file > upload,http://groups.google.com/group/cake-php/browse_thread/thread/be474455... > > Now the problem is, if I do t a regular Form post in my view like > > create('Resumedetail',array('action'=>'MyAdd')); ?> > > It adds the records and the file name to the database, but doesnt > actually upload the file. ( 777 permissions have been set to the > folder) > > But If I try to do this > > >create('Resumedetail',array('type'=>'file','action'=>'MyAdd')); ?> > > It throws up the following error: > Query: INSERT INTO `resumedetails` > (`resume_id`,`resume_content`,`pic`,`resume_file`) VALUES > (2,'ooo',Array,Array) > Its try to pass Array where I've defined the input box as "file" > > Here is the code I'm using > > View > > $form->create('Resumedetail',array('type'=>'file','action'=>'MyAdd')); ?> > > > __('Resumedetail');?> > echo $form->input('resume_id'); > echo $form->input('resume_content'); > echo $form->input('pic',array('type'=>'file')); > echo $form->input('resume_file',array('type'=>'file')); > ?> > > end('Submit');?> > > > --- Controller > --- > function MyAdd() { > if (!empty($this->data)) { > $this->cleanUpFields(); > $this->Resumedetail->create(); > if ($this->Resumedetail->save($this->data)) { > $this->Session->setFlash('The Resumedetail > has been saved'); > $this->redirect(array('action'=>'index'), > null, true); > } else { > $this->Session->setFlash('The Resumedetail > could not be saved. > Please, try again.'); > } > } > $resumes = $this->Resumedetail->Resume->generateList(); > $this->set(compact('resumes')); > } > > Any help will be greatly appreciated --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
File uploading using 1
Hi, I'm referring to the following excellent link to try and do a file upload, http://groups.google.com/group/cake-php/browse_thread/thread/be474455e24cbdb8/b7da5f84de301619?lnk=gst&q=file+upload+1.2%2B+chris#b7da5f84de301619 Now the problem is, if I do t a regular Form post in my view like create('Resumedetail',array('action'=>'MyAdd')); ?> It adds the records and the file name to the database, but doesnt actually upload the file. ( 777 permissions have been set to the folder) But If I try to do this create('Resumedetail',array('type'=>'file','action'=>'MyAdd')); ?> It throws up the following error: Query: INSERT INTO `resumedetails` (`resume_id`,`resume_content`,`pic`,`resume_file`) VALUES (2,'ooo',Array,Array) Its try to pass Array where I've defined the input box as "file" Here is the code I'm using View create('Resumedetail',array('type'=>'file','action'=>'MyAdd')); ?> input('resume_id'); echo $form->input('resume_content'); echo $form->input('pic',array('type'=>'file')); echo $form->input('resume_file',array('type'=>'file')); ?> end('Submit');?> --- Controller --- function MyAdd() { if (!empty($this->data)) { $this->cleanUpFields(); $this->Resumedetail->create(); if ($this->Resumedetail->save($this->data)) { $this->Session->setFlash('The Resumedetail has been saved'); $this->redirect(array('action'=>'index'), null, true); } else { $this->Session->setFlash('The Resumedetail could not be saved. Please, try again.'); } } $resumes = $this->Resumedetail->Resume->generateList(); $this->set(compact('resumes')); } Any help will be greatly appreciated --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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=en -~--~~~~--~~--~--~---
Re: basic Ajax file uploading
Thanks alot nate! Is there any example of this anywhere? nate wrote: how do i get it to properly upload the file? You don't. Because of the way the XHR transport layer works, you can't use it to send actual file data. What you *can* do is have the upload form POST to an iframe, and use a separate set of asynchronous requests to monitor it's progress. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: basic Ajax file uploading
> how do i get it to properly upload the file? You don't. Because of the way the XHR transport layer works, you can't use it to send actual file data. What you *can* do is have the upload form POST to an iframe, and use a separate set of asynchronous requests to monitor it's progress. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
basic Ajax file uploading
I have a form which is submitted via ajax. I have a field in this form which needs to be a file upload. below is the smippet of code. it's only sending me the local location of the file and not the actual file data. how do i get it to properly upload the file? labelTag('Reviselog/revfile', 'Revfile');?> file('Reviselog/revfile', array('size' => '60'));?> tagErrorMsg('Reviselog/revfile', 'Please enter the Revfile.');?> submit('Add', array('url' => '/reviselogs/add/'.$task['Task']['id'],'update' => 'tabcontent','loading'=>'showTabSaving();','enctype'=>'multipart/form-data')); ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Video file Uploading
http://www.raditha.com/php/progress.php poorna wrote: > hi all, > > Can any body guide me please how to upload video files using php > and how to maintain it? > Is there any thing diffrent way to upload a video files? > > Regards, > poorna > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Video file Uploading
hi all, Can any body guide me please how to upload video files using php and how to maintain it? Is there any thing diffrent way to upload a video files? Regards, poorna --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---