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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.