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 6801961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:09:55+00:00 2026-05-26T19:09:55+00:00

Okay, so this is a tough one, I’ve spent hours looking for a solution/problem.

  • 0

Okay, so this is a tough one, I’ve spent hours looking for a solution/problem. I’m using SWFUpload to upload images without reloading the page (with a fancy progressbar too), this works fine when I’m on localhost (Wamp server), but it goes nuts when I try to do so on my real linux server (which is the only possible flag as far as I could see), it’s running Apache2 and PHP5. As I said the front-end is fine (apart maybe from the fact it’s flash).
The back-end code is as follows:

SWFUpload_settings.js

var swfu_settings ={upload_url  : "upload.php",
                flash_url   : "flash/swfupload.swf",
                button_placeholder_id   : "upload_flash",
                file_size_limit : "2 MB",
                file_types  : "*.gif;*.jpg;*.png",
                file_post_name  :   "Filedata",
                file_queue_limit    :   1,
                post_params     :   {
                        "PHPSESSID" : getCookie()
                },
                upload_start_handler    : upload_start,
                upload_error_handler    : upload_error,
                upload_complete_handler : upload_complete,
                upload_progress_handler : upload_progress,
                file_queued_handler :   file_queued,
                button_disabled : false,
                button_width : 120, 
                button_height : 22,
                button_text : '<div class="adm_upload">Select image</div>',
                button_text_style : '.adm_upload{color:#ff0000;}'
                };

upload.php

function manageUpload(){
        if( isset($_FILES['Filedata']) ){
            $dest_dir = $_SERVER[DOCUMENT_ROOT]."/images/products";
            $destination =  $_SERVER[DOCUMENT_ROOT]."/images/products/" . $_FILES['Filedata']['name'];
            if( is_dir($dest_dir) ){
                if( is_writable($dest_dir) ){
                    if( !move_uploaded_file($_FILES['Filedata']['tmp_name'], $destination ) ){
                        $html_body = '<h1>File upload error!</h1>';
                        switch ($_FILES['Filedata']['error']) {
                            case 1:
                                $html_body .= 'The file is bigger than this PHP installation allows';
                                break;
                            case 2:
                                $html_body .= 'The file is bigger than this form allows';
                                break;
                            case 3:
                                $html_body .= 'Only part of the file was uploaded';
                                break;
                            case 4:
                                $html_body .= 'No file was uploaded';
                                break;
                            default:
                                $html_body .= 'unknown errror';
                        } 
                        echo ($html_body);
                    }
                }
                else{
                    echo "Says it's not writable: ".$dest_dir;
                }
            }
            else{//not a directory?
                echo "Says it's not a directory:".$dest_dir;
            }
        }
        else{
            echo "No file POSTED.\n";
        }
    }

The only error that I get is from $_FILES[‘Filedata’][‘error’] = 3, ‘Only part of the file was uploaded’. The destination directory does have 777 permission and you can see I made the required checks. It simply will not work, I have no idea why. Also, the files I tried uploading had no spaces in the filename, so that shouldn’t fit under the issue 206 with SWFUpload.

As far as I can tell it can be either due to the front-end SWFUpload or back-end server configuration. Please help.

P.S. no need to mention security, this is only allowed to be used by the server admin with external access anyhow, plus there’s the front-end limitation on the files he can select (images). There was no point securing it further.

  • 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-26T19:09:55+00:00Added an answer on May 26, 2026 at 7:09 pm

    So it turns out the problem was with the SWFUpload itself, it simply failed when used with linux servers. To anyone who has similar problems, consider using this instead:

    ridiculously easy to adapt, works out of the box and you can customize it to your hearts content with ease.
    I implemented all I wanted in under 20 minutes, it’s a pure delight to use and works well. Beautifully designed.

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

Sidebar

Related Questions

im really having a tough time trying to upload images using php and mysql,
I have one problem with semaphores, I though you could help me.. Okay first
Pointless Dribble Okay This is another weird one from me, i want to thank
Okay, this problem is a bit odd. I have an application built in VS2010
Okay this is a fairly broad question. This is my first App and I'm
Okay this is a real headscratcher. I have an application which calls a web
Okay this is not a question of how to get all uniques or How
Okay this may be a simple question but I have yet to come with
Okay this is my 4th question today on Scheme, still pretty new to Scheme,
Okay this is werid, i keep getting the error, randomly. ValueError: matrix must be

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.