Jump to content

Create New Folder on upload


gavin.sibley

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.