0

trying to upload pictures to a users folder /uploads/$uid i think i have the variable syntax right maybe the syntax in file path is incorrect /uploads/user/

(function($){
   $.simpleuploader = {version: '0.1'};
  $.fn.simpleuploader = function(options){
    // the container to inject the form into
    var $this = $(this);

    var user = '<?php echo $uid; ?>'; //is users id from session

    // set defults
    var defaults = {
        prefix: 'simpleuploader-',
        latency: 500,
        reuse: true,
        when: 'onchange',
        submitText: 'Submit',
        disabledOpacity: .3,
        settings: {
            fullPath: 'http://www.mysite.com/image_upload/uploads/user/',
            relPath: '../uploads/user/',

        },
4
  • 1
    Welcome to SO! What is not working? Are you getting any error messages? If so, what do they say? Commented Mar 6, 2012 at 20:24
  • Are the permissions set properly on your uploads directory? Commented Mar 6, 2012 at 20:25
  • the image doesn't load in folder permisions 707 Commented Mar 6, 2012 at 20:27
  • Remove the comma at the end of settings.relPath . Also, I would use var user = <?php echo json_encode($uid); ?>; //is users id from session instead, just in case $uid contains some complex symbols. Commented Mar 6, 2012 at 20:30

1 Answer 1

0

Were you trying to use the user variable when defining the paths? You should did it this way

var defaults = {
    prefix: 'simpleuploader-',
    latency: 500,
    reuse: true,
    when: 'onchange',
    submitText: 'Submit',
    disabledOpacity: .3,
    settings: {
        fullPath: 'http://www.mysite.com/image_upload/uploads/' + user + '/',
        relPath: '../uploads/' + user + '/',

    }
1
  • for some reason its not processing-- var user = '<?php echo json_encode($uid); ?>'; when i view the results-- fullPath: 'mysite.com/image_upload/uploads/<?php echo json_encode($uid); ?>';/ Commented Mar 6, 2012 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.