Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7611539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:41:17+00:00 2026-05-31T01:41:17+00:00

I am using uploadify for uploading the files with PHP 5.3.3 and Apache 2.2.16

  • 0

I am using uploadify for uploading the files with PHP 5.3.3 and Apache 2.2.16 server.
*All the image files I am using are small < 1M

Interestingly for some of the image files uploadify works fine and uploads the image file correctly. However for others only 8bytes are uploaded which is weird. I am not sure why the uploaded file is not complete.

Uploadify somehow says the file is 100% successfully uploaded and I am using the onError function too.

Any help in how to find out the problem would be really helpful.

Uploadify code:

$('#change_thumb_file').uploadify({
'hideButton'  : true,
'wmode'       : 'transparent',
'folder'      : VG.PROJECT_ROOT + '/static/apps/vialogues', 
    'uploader'    : VG.SITE_STATIC_URL+'uploadify/scripts/uploadify.swf',
    'script'      : VG.APPS_STATIC_URL+"vialogues/php/uploadify.php",
    'buttonText'  : 'Select an image',
    'cancelImg'   : VG.SITE_STATIC_URL+'uploadify/cancel.png',
    'auto'        :  true,
    'sizeLimit'   :  5242880,
    'queueID'     : 'fileQueue',
    'scriptAccess': 'always',
    'method'      : 'POST',
    'queueSizeLimit' : 1,
    'width'       : '100',
    'height'      : '30',
    'fileDesc'    : 'images',
    'fileExt'     : '*.jpg;*.jpeg;*.png;*.bmp;*.gif',
    'wmode'       : 'transparent',
    'altContent'  : '<div id="flash_notice">Flash player version 10.0.0 or above is required to upload a video. Please click the icon below to download Flash player.\
            <br /><a href="https://www.adobe.com/go/getflashplayer">\
            &nbsp;<img src="' + VG.SITE_STATIC_URL + 'uploadify/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33">\
            </a>\
            </div>',
    'onComplete' : function (event, queueID, fileObj, response, data){
        preview_uri = response.replace(VG.PROJECT_ROOT, '');
        $.ajax({
            url:VG.SITE_URL + 'vialogues/api/crop_thumbnail',
            type:'PUT',
            data: {'img': preview_uri}, 
            success: function(data){
                $('#thumb_preview').empty().append('<img src="'+preview_uri+'" />');
            },
            failure: function() {alert("There was an unexpected error. Please try again."); window.location.reload()},
        });
        $('#step_two').fadeIn();
    },               
    'onError' : function(event, queueID, fileObj, errorObj) {
              var errMsg = "There was an error uploading ... \n";
              errMsg += "Error type: " + errorObj.type + "\n";
              errMsg += "Error Info: " + errorObj.info + "\n";
              alert(errMsg);
            }
});

The code which does the file upload (uploadify.php):

if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_REQUEST['folder'] . '/';
$targetFile =  str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];

$fileTypes  = str_replace('*.','',$_REQUEST['fileext']);
$fileTypes  = str_replace(';','|',$fileTypes);
$typesArray = split('\|',$fileTypes);
$fileParts  = pathinfo($_FILES['Filedata']['name']);

if (in_array($fileParts['extension'],$typesArray)) {

    $result = move_uploaded_file($tempFile,$targetFile);
    if ($result) {
        echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$targetFile);         
    }
    else {
        echo 'Upload Failed';
    }
} else {
    echo 'Invalid file type.';
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:41:18+00:00Added an answer on May 31, 2026 at 1:41 am

    So the issue was happening in because of permissions problem. The workaround I did was to create a separate folder in the root directory and giving it explicit permissions to the www-data user under which apache runs. Somehow move_uploaded_file wasn’t throwing any errors for permission.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm uploading these files in apache, using php. is there any best way to
I have read the following tutorial Uploading Files To the Server Using PHP and
I have a php-script, which uploads mp3-files on my server. I use 'uploadify' for
I am uploading files using jQuery uploadify plugin. All files are uploaded into same
I'm uploading image files from device to a PHP server by converting the file
I am currently looking in to some file uploading using Java Server Faces. I've
How should I handle image uploading using PHP? How should I handle the chmod
I'm trying to upload files to server using Uploadify script and then show them
I am using uploadify and my problem is that the files are not uploading.
Very strange (to me) problem when uploading files to a server using ASIFormDataRequest. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.