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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:37:21+00:00 2026-06-11T13:37:21+00:00

I need an upload system which uploads to a specific preset URL based on

  • 0

I need an upload system which uploads to a specific preset URL based on its filetype, for example:

images will be uploaded to “exampleserver.com/upload/image” and videos will be uploaded to “exampleserver.com/upload/video”.

I had a look at http://blueimp.github.com/jQuery-File-Upload/ but I couldn’t manage to modify the code (might be lack of experience in JQuery plugins)

The upload system does need to support multiple file selection and be cross-browser compatible (with the exception of IE6).

Any suggestions or modifications to the code of the Jquery file upload plugin mentioned above are greatly appreciated.

EDIT: the server where images and videos are uploaded to are NOT mine, they are Facebook’s.

  • 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-06-11T13:37:22+00:00Added an answer on June 11, 2026 at 1:37 pm

    For this to work your client’s need to have HTML5 support, File, FileList and Blob. You can see a demo how this works.

    Changing the settings in the uploader is quite simple: (documentation find “Options” )

    $('#fileupload').fileupload(
        'option',
        'url',
        '/path/to/upload/handler.json'
    );
    

    I would suggest you submit images and videos to the same locations and make the check on the server side. That will make your life much easier.

    Edit:
    Here is how you can check the extension and submit images and videos to different scripts:

    function checkFileExtension(file) {
        var extension = file.name.split('.').pop().toLowerCase();
        var image_extensions = ['gif', 'png', 'jpg', 'jpeg'];
        var video_extensions = ['mp4', 'avi', 'wmv'];
        // The file extension is not in the array
        if ($.inArray(extension, image_extensions) >= 0)
            return "image";
        else if ($.inArray(extension, video_extensions) >= 0)
            return "video";
        else
            return "notAllowed";
    }
    
    // Initialize the jQuery File Upload widget:
    $('#fileupload').fileupload({
        // This is triggered when you drag'n'drop a file over the uploader
        drop:  function (e, data) {
            $.each(data.files, function (index, file) {
                // The file doesn't pass checkFileExtension, return an error
                var extension = checkFileExtension(file);
                if (extension != "image" && extension != "video") {
                    // Print an error message in the UI
                    file.error = "File extension not allowed!";
                }
            });
        },
        // This is triggered when you click a button and select files from a list.
        change:function (e, data) {
            $.each(data.files, function (index, file) {
                // The file doesn't pass checkFileExtension, return an error
                var extension = checkFileExtension(file);
                if (extension != "image" && extension != "video") {
                    // Print an error message in the UI
                    file.error = "File extension not allowed!";
                }
            });
        },
        // This is triggered on every file in the queue when you click "Upload"
        submit: function (e, data) {
            // The file is an image - submit those to
            if (checkFileExtension(data.files[0]) == "image") {
                $('#fileupload').fileupload(
                    'option',
                    'url',
                    '/upload/images'
                );
            }
            // The file is a video.
            else if(checkFileExtension(data.files[0]) == "video"){
                $('#fileupload').fileupload(
                    'option',
                    'url',
                    '/upload/videos'
                );
            }
            // The file is not a video/image - don't submit the file.
            else {
                return false;
            }
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to set up a system in which user uploaded files will
I need to update a software which uploads existing PDF reports on Force.com to
I need to accept images uploaded by the users, and do some processing in
I am trying to create a system which enables user to upload a zipfile,
Does anyone know of the file upload system which I can use for my
I am building a system which lets users upload shapefiles. It then converts those
Im desiging an app which allows users to upload images (max 500k per image,
I have sucessfully managed to make a file upload system which basically is copying
I need a rich textarea in which we have the option to insert images
I need to upload my customized excel file in magento admin panel. This excel

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.