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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:07:33+00:00 2026-05-16T16:07:33+00:00

I am using the Uploadify Plugin to Upload files. although this might be a

  • 0

I am using the Uploadify Plugin to Upload files. although this might be a very basic question i am unable to understand and implement to get it work to upload the files.

I want to achieve the following using uploadify

when a user select the file i want it to be directly uploaded to the target path using PHP.

now i am using the following code.

<html>
<head>
<link rel="stylesheet" href="css/uploadify.css" type="text/css" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.uploadify.v2.1.0.min.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
</head>

<script type="text/javascript">
$(document).ready(function() {
    $('#someID').uploadify({ 
      'uploader': 'img/uploadify.swf',
      'script': 'uploadify.php',
      'folder': 'upload',
      'cancelImg': 'img/cancel.png',
      'auto': 'true',
      'fileDesc': 'jpg/jpeg',
      'displayData': 'percentage',
      'fileExt': "*.jpg;*.jpeg",
      'sizeLimit' : '8388608'
      }); }); 
      </script>

<body>
<form id="someID" action="uploadify.php" method="post" enctype="multipart/form-data"> 
<input type="file" name="file" id="fileUpload1"/>
<p><input type="submit" name="submit" value="Upload" /></p> 
</form>
</body>

and this is the code for uploadify.php

if (!empty($_FILES)) {
    $tempFile = $_FILES['file']['tmp_name'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
    $targetFile =  str_replace('//','/',$targetPath) . $_FILES['file']['name'];
    move_uploaded_file($tempFile,$targetFile);
        echo "1";

I just want to upload a single file. do i need to include the check.php for that. how do i make something like when a user select the image file it directly performs the operation and move to the designated directory.

P.S: I have the very basic understanding of javascript and jquery. 🙂

Note : file uploading problem is solved now.

how do i limit the user from uploading
just one file on one button, i want
something like when a user select the
file and it gets uploaded that button
should be disabled or something

EDIT : for limiting the users from uploading multiple file in a button i added this code and it is still uploading many files as and when users select multiple times. here is my code.

<script type="text/javascript">
$(document).ready(function() {
    $('#someID').uploadify({ 
      'uploader': 'img/uploadify.swf',
      'script': 'uploadify.php',
      'folder': 'upload',
      'cancelImg': 'img/cancel.png',
      'auto': 'true',
      'fileDesc': 'jpg/jpeg',
      'displayData': 'percentage',
      'fileExt': "*.jpg;*.jpeg",
      'sizeLimit' : '8388608',
      'fileDataName' : 'file',
      onSelect : function(){
           $("#someID input").attr("disabled", true);
      }
      }); }); 
      </script>

what is wrong with it?

  • 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-16T16:07:33+00:00Added an answer on May 16, 2026 at 4:07 pm

    I was wrangling with this a few weeks ago. You need to change your fileDataName attribute. By default, it is Filedata. You are trying to access it as file in this part: $_FILES['file'].

    Either change all instances of $_FILES['file'] to $_FILES['Filedata'] or add this attribute to your $('#someID').uploadify({}); attribute collection: fileDataName:'file'.

    If you are looking for a drop-in fix, just make this change in your JavaScript:

    $(document).ready(function() {
        $('#someID').uploadify({ 
          'uploader': 'img/uploadify.swf',
          'script': 'uploadify.php',
          'folder': 'upload',
          'cancelImg': 'img/cancel.png',
          'auto': 'true',
          'fileDesc': 'jpg/jpeg',
          'displayData': 'percentage',
          'fileExt': "*.jpg;*.jpeg",
          'sizeLimit' : '8388608',
          'fileDataName' : 'file'
          }); 
    }); 
    

    Note the 'fileDataName' : 'file'

    To limit a single upload (as long as the page isn’t refreshed, of course):

    Change your JavaScript to this:

    $(document).ready(function() {
        $('#someID').uploadify({ 
          'uploader': 'img/uploadify.swf',
          'script': 'uploadify.php',
          'folder': 'upload',
          'cancelImg': 'img/cancel.png',
          'auto': 'true',
          'fileDesc': 'jpg/jpeg',
          'displayData': 'percentage',
          'fileExt': "*.jpg;*.jpeg",
          'sizeLimit' : '8388608',
          onSelect : function(){
               $("#someID input").attr("disabled", true);
          }}); 
    }); 
    

    Just know that if the user refreshes the page, the button will be enabled again allowing them to upload another file. They can also re-enable it manually. So, add a server-side check to make sure that they don’t upload another file if you don’t want them to.

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

Sidebar

Related Questions

I'm using the uploadify jquery plugin to upload multiple files. Everything works fine, but
i am using the jQuery Plugin Uploadify to upload files, and i store the
I'm using the Uploadify plugin to upload files to my server, and I want
I am using uploadify plugin of jquery and have set multiple files upload to
I am using uploadify plugin to upload files and update them in mysql database.
I have a plugin for uploading files using jquery uploadify. After calling a method
I am using Uploadify to upload files. Problem is, I need to inform users
I have a problem. I'm using the jQuery plugin Uploadify v. 2.1.4 to upload
I'm trying to upload files to server using Uploadify script and then show them
I am using jquery ajaxupload plugin to upload files .I have the following js

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.