Re: File uploads and Media Plugin

2010-10-28 Thread David Persson
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

Re: File Uploads: What security-issues I have to take care of?

2009-09-01 Thread the_woodsman
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

Re: File Uploads: What security-issues I have to take care of?

2009-09-01 Thread Miles J
@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

Re: File Uploads: What security-issues I have to take care of?

2009-09-01 Thread David Persson
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

Re: File Uploads: What security-issues I have to take care of?

2009-08-31 Thread Miles J
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

Re: File Uploads: What security-issues I have to take care of?

2009-08-31 Thread Stinkbug
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

Re: File Uploads: What security-issues I have to take care of?

2009-08-31 Thread Miles J
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

Re: File Uploads: What security-issues I have to take care of?

2009-08-31 Thread DigitalDude
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

Re: File Uploads: What security-issues I have to take care of?

2009-08-31 Thread Miles J
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

Re: File Uploads: What security-issues I have to take care of?

2009-08-30 Thread Miles J
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

Re: File Uploads: What security-issues I have to take care of?

2009-08-30 Thread DigitalDude
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

Re: File Uploads: What security-issues I have to take care of?

2009-08-30 Thread DigitalDude
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

Re: File uploads - getting an undefined index.

2009-06-25 Thread number9
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

Re: File uploads - getting an undefined index.

2009-06-21 Thread number9
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

Re: File uploads - getting an undefined index.

2009-06-21 Thread brian
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

Re: File uploads timing out

2008-11-01 Thread acoustic_overdrive
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

Re: File uploads timing out

2008-10-31 Thread Adam Royle
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,

Re: File Uploads

2006-12-05 Thread Brian French
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

Re: Re: File Uploads

2006-12-05 Thread Samuel DeVore
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

Re: File Uploads

2006-12-05 Thread [EMAIL PROTECTED]
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

Re: File Uploads

2006-12-04 Thread Mikee Freedom
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

Re: File uploads, image uploads

2006-06-26 Thread clemos
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

Re: File uploads, image uploads

2006-06-26 Thread poorna
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 ?

Re: File uploads, image uploads

2006-06-25 Thread linkingarts
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

Re: File uploads go where?

2006-05-12 Thread roberts.sean
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