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 Link to comment https://forums.phpfreaks.com/topic/260446-create-new-folder-on-upload/ 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? Link to comment https://forums.phpfreaks.com/topic/260446-create-new-folder-on-upload/#findComment-1334978 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 Link to comment https://forums.phpfreaks.com/topic/260446-create-new-folder-on-upload/#findComment-1334999 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? Link to comment https://forums.phpfreaks.com/topic/260446-create-new-folder-on-upload/#findComment-1335008 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 Link to comment https://forums.phpfreaks.com/topic/260446-create-new-folder-on-upload/#findComment-1335011 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? Link to comment https://forums.phpfreaks.com/topic/260446-create-new-folder-on-upload/#findComment-1335013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.