Tip: Properly handling uploaded files

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Tip: Properly handling uploaded files

Post by calguy1000 »

Nothing has been said about this to date... but some module developers have gotten it right anyways.... and others haven't....

When handling an upload in CMSMS, you should use the cms_move_uploaded_file($src,$dest) method instead of rename() or even move_uploaded_file($src,$dest).

This ensures that the permissions of the moved file match those specified in the $config['default_upload_permission'] config entry.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Developers Discussion”