gavin.sibley Posted April 6, 2012 Share Posted April 6, 2012 Hello, i am looking for a way to create a new folder when a customer uploads photos. I would like the folder to be named their email address. The photo uploader code is below: - [php <?php if($logged[scrollingpicturedisplay] == "yes"){ if($difference == "Gone"){ }else{ if($logged[spd_process] == "1"){ }else{ ?> <div id="spd"> <link href="/uploadify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="/swfobject.js"></script> <script type="text/javascript" src="/jquery.uploadify.v2.1.4.min.js"></script> <script type="text/javascript"> $(function() { $('#custom_file_upload').uploadify({ 'uploader' : '/uploadify.swf', 'script' : 'uploadify.php?user=<?php echo("$logged[ip]");?>', 'cancelImg' : '/cancel.png', 'folder' : '/wuploads', 'multi' : true, 'auto' : true, 'fileExt' : '*.ZIP;*.zip;*.rar;*.jpg', 'queueID' : 'custom-queue', 'queueSizeLimit' : 1000, 'simUploadLimit' : 1000, 'removeCompleted': true, 'onSelectOnce' : function(event,data) { $('#status-message').text(data.filesSelected + ' files have been added to the queue.'); }, 'onAllComplete' : function(event,data) { $('#status-message').text(data.filesUploaded + ' files uploaded, ' + data.errors + ' errors.'); php/] and i think this is the code for the create new folder [php <? mkdir("/wuploads/{$slide['email']}"); ?> php/] The email is stored on the users database as the field 'email' i then would like it to put the photos in the created folder which i think is something like this [php 'folder' : '/wuploads/$slide['email']', php/] The pictures go into the correct folder if i use this, however the create folder part of it doesnt seem to work. any help would be great, thanks Quote Link to comment Share on other sites More sharing options...
batwimp Posted April 6, 2012 Share Posted April 6, 2012 have you echoed out $slide['email'] to make sure it has a valid value? Quote Link to comment Share on other sites More sharing options...
gavin.sibley Posted April 6, 2012 Author Share Posted April 6, 2012 Hello Batwimp, Yes $slide['email'] is used in other parts of the script loads of times for various different jobs and always pulls the correct value, just cant seem to get it to work in this instance. thanks Quote Link to comment Share on other sites More sharing options...
batwimp Posted April 6, 2012 Share Posted April 6, 2012 Do you have correct write permissions to that folder? Quote Link to comment Share on other sites More sharing options...
gavin.sibley Posted April 6, 2012 Author Share Posted April 6, 2012 yes permissions are set to 777 and i can put/edit/delete the photos into that folder, just cant create a folder within that folder Quote Link to comment Share on other sites More sharing options...
batwimp Posted April 6, 2012 Share Posted April 6, 2012 I'm assuming you're using a Linux OS. Do you have error reporting turned on? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.