field than after submit, where the file field
is missing in the $data array.
I did some searching and found that SimpleTest should be able to
simulate file uploads:
File upload testing - Can simulate the input type file tag on
http://www.simpletest.org/api/SimpleTest
I followed this
tutorial:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper%3a%3afile
*My View / Form*
?php echo $this-Form-create(User, array(enctype =
multipart/form-data)); ?
?php echo $this-Form-hidden(User.id); ?
?php echo $this-Form-input(User.picture_file,
On Wed, Jan 23, 2013 at 11:10 AM, Shahruk Khan shahruksem...@gmail.com wrote:
I followed this tutorial:
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper%3a%3afile
My View / Form
?php echo $this-Form-create(User, array(enctype =
multipart/form-data)); ?
echo
Nope. debug($this-data) still has no other info.
On Wednesday, January 23, 2013 1:53:27 PM UTC-5, cricket wrote:
On Wed, Jan 23, 2013 at 11:10 AM, Shahruk Khan
shahru...@gmail.comjavascript:
wrote:
I followed this tutorial:
Check your PHP configuration and ensure that your file upload settings are
appropriate for the use-case.
Also, print out the _FILES array to also check to see if PHP is accepting your
upload.
On Jan 23, 2013, at 3:09 PM, Shahruk Khan shahruksem...@gmail.com wrote:
Nope. debug($this-data)
The files were not being accepted. Solved the problem thanks! Just in case
anyone has the same problem.
You cannot serialize file upload forms via jQuery and pass them to the
controller.
On Wednesday, January 23, 2013 6:15:59 PM UTC-5, ibejohn818 wrote:
Check your PHP configuration and
Anyone know of a good progress bar for file uploads?
Don't need anything fancy, just something that gives users visual
feedback that the large image file they are uploading is taking some
time to transfer.
Thanks,
bill
--
View this message in context:
http://cakephp.1045679.n5.nabble.com
use uploadify
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/4/16 bs28723 bill.sto...@boosterwebsolutions.com
Anyone know of a good progress bar for file uploads?
Don't need anything fancy, just something that gives users visual
feedback that the large image file they are uploading
Use http://www.johnboy.com/php-upload-progress-bar/
--
Sebastian Maydana
Interac*team*
El 16 de abril de 2012 11:18, bs28723
bill.sto...@boosterwebsolutions.comescribió:
Anyone know of a good progress bar for file uploads?
Don't need anything fancy, just something that gives users visual
Hi stab,
I don't really know about ajax-upload. As I'm using plupload in one of
my projects and guess it's similar. You're right the media plugin's
transfer behavior doesn't natively handle streams, yet. Here's an
excerpt of the code I'm using to workaround that:
if
I'm trying to use this: http://valums.com/ajax-upload/ with the media
plugin here http://github.com/davidpersson/media
I've got it setup ok, and it is attached to a Document model.
I can also get the qquploader uploading fine using it's own examples
and class libraries. I need to find a way to
::_validatePost() fails because when displaying the
form there is one more field than after submit, where the file field
is missing in the $data array.
I did some searching and found that SimpleTest should be able to
simulate file uploads:
File upload testing - Can simulate the input type file tag
The file uploads are working fine without Sanitize::clean(). The only
solution I see is to handle the file validation/copy logic before
executing the sanitization. I'm puzzled.
Maybe I should mention that I'm running on my local windows machine
using XAMPP. But all the php.ini upload-related
']))
{
[...] // etc etc
}
}
}
}
No problems encountered using this approach.
On May 20, 9:38 am, Michele Ferri zomgs...@gmail.com wrote:
The file uploads are working fine without Sanitize::clean(). The only
solution I
Hello.
I'm using Sanitize::clean for cleaning the $this-data arrays in the
controllers before saving them to the db.
example
if (!empty($this-data))
{
$this-data = Sanitize::clean($this-data);
[...]
}
The problem is that if a form contains a file input, the file is not
uploaded.
Were the file uploads working before you used Sanitize::clean? Because
cake doesn't handle file uploads automatically. Aside from having to
set array('type'='file') in your $form-create() statement, you also
need to move/save the uploaded file yourself.
Unless you're manually moving the file
I am looking to use a CakePHP form to upload a file and then submit it
to another website using httpsocket. Is this possible given the
current implementation of httpsocket in Cake (i.e version 1.2.6), and/
or will it be available in 1.3?
Any info on how to do this appreciated.
Stuart
Check out
RE The media view - I try and avoid this unless it's a real security
requirement, as it means every request for a simple image requires
CakePHP to handle it, vastly increasing the load on yoru servers, and
the latency for that file.
An alternative is to save each file based on a UUID, or similar
@woodsman - No I agree with you.
I was simply showing him the media view because you he wanted to
supply downloads/files to users.
On Sep 1, 4:21 am, the_woodsman elwood.ca...@gmail.com wrote:
RE The media view - I try and avoid this unless it's a real security
requirement, as it means every
A few things to keep in mind are:
* Don't just validate against the MIME type submitted by the client,
verify the MIME type by inspecting the uploaded file directly.
* Image transformations help to prevent some exploits (i.e. by
stripping comment metadata).
* Uploaded files shouldn't be directly
Haha awesome, glad someone found it useful :]
--~--~-~--~~~---~--~~
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
There is one thing to keep in mind when uploading files and that's the
security risks in uploading files to the webroot where people can
access them directly. It's generally recommended to upload files to a
directory outside of the webservers document root and give them a
unique name, so that
Yeah but thats pretty pointless if your just uploading images.
But yes what you said would be the ideal situation if you want to do a
download system, or supply files to users.
On Aug 31, 4:56 am, Stinkbug justink...@gmail.com wrote:
There is one thing to keep in mind when uploading files and
Hey,
yeah that's what I intend to do. I used your Uploader to upload files
for testing purposes, this works well, BUT I think that the allowed
mimetypes are not working as they should. I can upload ANY file,
although I allowed only JPEG and GIF to the plugin. That's a bit
weird, but I'm sure
Regarding the mimetype, it allows all mimetypes listed in the config
folder. If you want to restrict the type, use the file validation
behavior.
For the second part of your question. You would do a normal controller
action setup like /files/download/1 and then use the media view and
your own
Hey,
in my first real and own project, I want to implement the ability to
upload files to a user's account. The filetypes I need to be able to
upload are:
- PDF
- JPG
- GIF
- PNG
- XLS
- DOC
- OpenOffice Documents
- ZIP
- RAR
Before I start to implement a file-uploading action, I need to
A few here:
- Check the extension as well as the mimetype
- Only allow certain types
- Check the filesize if needed
- Make sure the file is a valid file resource
- Make sure there are no errors upon uploading
I however have create a file upload plugin. You can use the plugin
itself or you can
Hey,
I couldn't wait and tried out your Plugin. And, well, it works like a
charme! It does everything I want to do right from the start, the data
I need is stored, I can even set the path where the files are uploaded
to within the action (so I can save the files in a separate directory
for each
Hey,
this looks nice, and I like the fact that it can handle mutliple files
at one time!
I will try to implement this into my project, and then start to
customize it to fit my requirements. I want to create some records in
the database for each uploaded file, but I'm sure this is gonna work
Hi,
I'm working in a plugin for my system to manage uploads. It includes
an Uploadable behavior.
Is it possible to unit-test the upload part in some way? That is, is
there a way to mock a file upload to the server.
My B plan is try to isolate the move_uploaded_file() part into a
method,
Apologies for the late reply - I solved this, it was a really silly
error on my part!
I was accessing the array but not the specific field I needed.
On Jun 21, 5:37 pm, brian bally.z...@gmail.com wrote:
What does the controller code look like now? Specifically, where it
interacts with your
OK, so I have solved the undefined index problem - the view file was
wrong, it should have been Tip.image instead of just image. However,
I changed it to Img.pic so as not to clash with image.
I'm now getting the following error when trying to add:
Notice (8): Array to string conversion
What does the controller code look like now? Specifically, where it
interacts with your ImageComponent.
On Sun, Jun 21, 2009 at 11:46 AM, number9xpozit...@gmail.com wrote:
OK, so I have solved the undefined index problem - the view file was
wrong, it should have been Tip.image instead of just
I'm trying to add the ability to upload files on an existing add
method within a controller, but no matter which method I use to try
and upload files I get an undefined index error on the name of the
field within the view and I cannot understand why.
I thought it may have been a problem with the
Are you using safari by any chance? I sometimes find that safari gets
stuck while doing POSTs containing files, while firefox doesn't have a
problem and I've never got to the bottom of it. But this was happening
to me before I started using cake as well as now.
On Oct 31, 11:08 pm, Adam Royle
Hi all,
I've been drawn back into cake (and some of you may remember me from
WAAAY back - I have ticket number 1 on cake :) , wondering if
anyone can help:
My image uploads appear to be timing out - I'm using the Authenticate
component and some digging has revealed some sort of issue over
You didn't mention what technique you were using to upload files,
however here is one idea.
If you are doing a flash upload, some browsers (can't remember which)
won't complete the request until data is returned from the server. So
in my upload action I always output a space. exit(' ');
Also,
also, if you want to store the data of the file in the database instead
of just in a file, you should also base64_encode(); the data before
saving it to either a blog or text datatype.
when you want to retreive you do:
?php
// header to let the browser know what type of file it is
// saee
which can have the effect of tripling the data size, just so you keep
that in mind when setting up your db
On 12/5/06, Brian French [EMAIL PROTECTED] wrote:
also, if you want to store the data of the file in the database instead
of just in a file, you should also base64_encode(); the data
I wouldn't save to a DB. Just move the file based upon the user id or
something and automatically create folders based on the user id or
whatever.
I would think it to be a security hazard if you did do that. Also, you
will increase the size of your db which could degrade performance.
People are
Ok so i am having some major issues getting file uploads going on my
cake app.
Firstly what seems to happen is as soon as i add
'enctype=multipart/form-data' to mthe form in my view,
my call to $this-Model-save($this-data) in the controller spits the
dummy as the file field is now an array
Sorry, after a bit of a reread don't forget to record the path of your
file somewhere. Either in the database itself or I tend to include it
as a constant or attribute of my model so I can move stuff easily.
cheers,
mikee
On 05/12/06, Mikee Freedom [EMAIL PROTECTED] wrote:
Hey Paul,
File
hi jon and all
what is on line 219 of your
/myserver/app/controllers/businesses_controller.php ?
for file upload, I actually use this component which does perfectly the job :
http://cakeforge.org/snippet/detail.php?type=snippetid=36
I've written my own File model, FilesController and stuff
hi friends,
if v upload a file ,then the file(which was uploading by me) goes to
where??
whether it wil go to database/webserver???
plz reply immediately.. i am new to php...
clemos wrote:
hi jon and all
what is on line 219 of your
/myserver/app/controllers/businesses_controller.php ?
jb-
thanks for the input but that isn't exactly the issue. What I don't
quite get is a) why I'm getting an index error, and b) how to
populate the db (with the imageFile [name] value in addition to the
other values passed by the form) at the same time I'm uploading the
file into a specific
I followed the tutorial found here on handling file uploads, but I'm
stuck on one thing.
http://groups.google.com/group/cake-php/browse_frm/thread/fe4c9d7739f8be2a/4bede155456ff93f?q=file+uploadrnum=4#4bede155456ff93f
Normally when PHP fails a file-upload it gives me a bunch of warnings
Oh... apparently they go in /app/webroot/img... what a surprise.
Nothing to see here :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to
47 matches
Mail list logo