I've seen that many people have problems with "Safe Mode On" settings in CMS Made Simple (CMSMS), when trying to upload one or more files to a newly created directory. The problem isn't trivial so the solution (that I came up with) is more a "work around" than a fix.
My case is as follows: "I have a client that has changed to a new hosting parter where it's not possible to disable the Safe Mode setting". Thus, when the user wants to upload new files they first create a new directory and then upload the file int this directory.
The problem is that the newly created directory has new permissions, typically with httpd rights rather than user right. Thus, it's only possible to create the directory but not to upload any files to the directory. The solution is to use ftp_mkdir in php instead. That way we can log in to the account and create the directory with user rights. Pretty simple if you think about it. In CMSMS you need to go to admin directory and open the file "imagefiles.php" and go to approx. line no. 123 (from v.1.2.3). Customize the following code such that it fits you own ftp account:
//mkdir($dir."/".$_POST['newdir'], 0777);
$server='ftp-server-address';
// ftp server $connection = ftp_connect($server);
// connection // login to ftp server $user = "ftp-username";
$pass = "ftp-pass";
$result = ftp_login($connection, $user, $pass);
$newDir = $dir.$_POST['newdir'];
$newDir = substr($newDir, 30);
//only for my server solution - might be diff. for you // check if connection was made
if ((!$connection) || (!$result)) { } else {
if(ftp_mkdir($connection,$newDir)) {
// create directory ftp_chmod($connection, 0777, $newDir);
} else { }
ftp_close($conn_id);
// close connection //exit();
}
audit(-1, $_POST['newdir'], 'Created Directory ddd');
NOTE: this solution worked with my hosting partner, surftown.dk. Let me know if you have another fix that might work. I hate this safe-mode problem......

Nice! Additional info: php5
Nice!
Additional info: php5 is required to get "ftp_chmod" to work.
Yes I too have experienced
Yes I too have experienced the same problem with your client. For that I avoid to change hosting or a domain, because the displacement process is very complicated and certainly inconvenient. erp software reviews
convert m4v video
M4V Converter for Mac , Mac M4V Converter, Convert M4V Mac M4V to AVI Converter for Mac First Step, Just follow me to know more about M4V Converter: M4V to MP4 Converter for Mac The M4V Converter Mac is specially designed for Mac users to convert video M4V to FLV Converter for Mac files between all popula video and audio formats. M4V to WMV Converter for MacBesides, the powerful M4V Converter Mac software can let your enjoy your various videos on all sorts of playback M4V to MPEG Converter for Mac including PSP, iPod, Mobile Phone, Zune, iPhone, Apple TV and MP4/MP3 player. M4V to 3GP Converter for Mac Powerful Editing Function is provided such as Crop Video, M4V to MOV Converter for Mac Trim video or audio, Merge Video, adjust video effect, customize video output settings, M2TS to M4V Converter for Mac etc by the professional M4V Converter Mac OS X VOB to M4V Converter for Mac software. Tips: Support High-Definition and Standard Video ------ High-Definition video formats including AVCHD (MTS/M2TS), AVCHD Lite, HD MKV(H.264, MPEG-2 HD), HD WMV(VC-1), DAT to M4V Converter for Mac HD MOV(H.264, MPEG-4), HD TS, etc. M4V to PSP Converter for Mac and standard videos to WMV, MP4, FLV(Flash for posting online), M4V to iPod Converter for Mac AVI, MOV, MPG/MPEG, DV, etc. M4V Converter Mac convert M4V files to many popular video and audio files on Mac OS X with Mac M4V Converter! M4V to iPhone Converter for Mac
This is an interesting site
This is an interesting site and informative. I really impressed from this site.
professional business plan writers
Nice workaround! Have you
Nice workaround!
Have you delved any further into using this approach for other issues, such as module installation or theme installation? I've searched briefly through the site files, but my understanding of php isn't strong enough to reverse engineer these issues.
Any thoughts?
Hey guys. Thx for your
Hey guys.
Thx for your replies.
@Ed: no, I haven't delved further down to merging this approach with module / theme installs.
But it should be possible to use this approach as a general upload functionality in CMSMS.
If I get the time to develop such a module I'll post it both on this website and on cmsmadesimple.org
I daily watch your website
I daily watch your website because it helps me in my many works and it is very beneficial for me because it gives the work a professional touch that is really an amazing thing. tow operator answering services
Cool, I'll poke around in the
Cool, I'll poke around in the code a bit as well, if I get a chance.
And glad I checked back; I just downloaded fontdoc, which you posted about after this post!
It's really an outstanding
It's really an outstanding and exciting to research. Never stop! This is one of the best blogs I have ever research. You have mad capabilities here. I just wish that you will not decrease your style because you are certainly one of the best web entrepreneurs. hcg canada group
People should read this.
People should read this.
[...] Solution Use the ftp
[...] Solution Use the ftp functions in PHP to create the folders Se how at Henrik Hedegaard [...]
Works like a charm - you are
Works like a charm - you are the man !
Made a solution for the Typo3 install tool:
http://p2e.dk/noter/?p=217
Note for PHP4:
Use "ftp_site($connection,"CHMOD 0777 " . $newDir);" to set the permissions
Thanks
Thanks for the information. The solution is not difficult as usual. As for me, I often find answers to my question about CMSMS in different tutorials http://www.tubestime.com/watch/cms-made-simple-tutorial . I think they are very helpful.
wow :)
Thanks for the information.
it looks great.
I've searched briefly through
I've searched briefly through the site files, but my understanding of php isn't strong enough to reverse engineer these issues.
hi
I just downloaded fontdoc, which you posted about after this post!
Torrents
Very rarely, I came across a
Very rarely, I came across a web page that is both useful and exciting, and I want to tell you that you have hit the take on the go. Your web page is important that this is something that not enough people to talk about properly. bend oregon vacation rentals
Useful tutorial, clearly
Useful tutorial, clearly written and good reminder about the multiple levels of undo - always handy I find.
I agree with you here. It is
I agree with you here. It is definitely more of a work around them anything. This will work if you do it properly. Keep up the good work. Tutoring Manhattan
Quite technical but then it
Quite technical but then it is good that you are providing such people who may seem stuck a way out. With this one will be able to know where to get help whenever they are trying to upload one or more files to a newly created directory.
barefoot beach naples florida
This is actually satisfied
This is actually satisfied through the great info is seen within this blog that to discussing the truly amazing info is seen within this blog. I'm really helpful info with this website and taking advantage of the truly amazing technology within this website.casino postepay
Not that simple to do it
Is not simple, but for sure is going to increase the safety procedure of cms.
Especially when you have Casinò sites.
Thanks for sharing.
Dive center websites are
Dive center websites are increasing with the passage of time. I agree with your point and info you have provided here. I want more description about this topic in coming days. bodybuilding supplements
Are you sure ?
Are you sure ?
Here is my comment to show my
Here is my comment to show my appreciation to this post. It is just that one I was looking for and I can say I have found it. John Harman have always tried to understand this but here it is my only solution.cheap printing can now be mentioned so I inviting all to accept this.
Working in Safe Mode has
Working in Safe Mode has always bugged me, because I never knew how to upload my files. I thought about getting a registry cleaner from paretologic's website to clean everything up, but fortunately I found your solution instead. Using ftp_mkdir in php has never crossed my mind, but it seems like the right thing to do. Thanks!
That's great. Thanks for
That's great. Thanks for discussing the solution.
Nice post
I really loved reading your blog. It was very well authored and easy to understand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting.London Paris New York Songs Download
Re:Nice
This blog post was absolutely fantastic. When I used to work in electroplating they sometimes encouraged us to write, but I could never come up with something as well written as that
Re:Nice
I found your site while stumbling. allowed me to really understand this issue. I really learned a lot from your site. You are doing good work!Sadda Adda Songs Download
Good Post
Thank you for another great article. Where else could anyone get that kind of information in such a perfect way of writing? I have a presentation next week, and I am on the look for such information.Players Movie songs Download
Amazing Post
I found this site very informative because very qualitative stuff is available over here.Thanks.
English Songs Download
Wow nice post
I wanted to thank you for this excellent read. its very fine post. thanks for sharing it.I found so many interesting stuff in your blog especially its discussion.Ek Deewana Tha Songs Download
Nice post
Its really a great post. I am sure that anyone would like to visit it again and again. After reading this post I got some very unique information which are really very helpful for anyone. This is a post having some crucial information. I wish that in future such posting should go on.London Paris New York Songs Download
Re:Nice
I have read many blogs and found good and informatics but this blog has simply thrill me with it designs, colour combination and the most important thing real information. I have found only genuine and useful information on this blog.Sadda Adda Songs Download
great
I must say this is quite interesting Information. From a very long time i was searching for this type of blog.
I am looking forward to more such School Grantsposts in future. Thanks for sharing.
inof
interesting
Post new comment