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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:04:10+00:00 2026-06-11T07:04:10+00:00

Basically what I’m trying to do is generate an alphanumeric string, which is passed

  • 0

Basically what I’m trying to do is generate an alphanumeric string, which is passed to the php handler, as well as back to the upload form. When the upload is complete, the form then creates a link using the alphanumeric string.

I’ve gotten everything to work, except for one issue. There is only one random string that’s generated, so if you try to upload multiple files at the same time, every one of them has the same string name. I need them each to have different names, but I can’t seem to figure out how, while still being able to pass back to the form and the php.

Here’s my script:

<script>
    function randomString(length, chars) {
        var result = '';
        for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
        return result;
    }
    var sessid = '';
    var data = document.getElementById('data');
    $(document).ready(function () {

        $('#myModal').modal({
            show: false
        });
        $('#mm').modal({
            show: false
        });

        $(function () {
            $('#file_upload').uploadify({
                'fileObjName': 'file',
                'fileSizeLimit': '8MB',
                'buttonText': 'BROWSE FILE(S)...',
                'fileTypeExts': '*.JPEG; *.GIF; *.PNG; *.APNG; *.TIFF; *.BMP; *.PDF; *.XCF',
                'cancelImg': 'uploadify-cancel.png',
                'swf': 'uploadify.swf',
                'uploader': 'uploadify.php',
                'formData': randomString(7, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'),
                'auto': false
            });
        });
    });
</script>

I also made a small modification to jquery.uploadify-3.1.min.js, which allowed for the random string to be passed back to the form.

if (c.inArray("onUploadSuccess", g.overrideEvents) < 0) {
    c("#" + f.id).find(".data").html(" - " + this.settings.post_params);
}

If anyone wants to see it all in action, you can see it here: http://icap.me/test/files.php
Ignore the broken design, for now I’m just trying to get it to work.

  • 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-11T07:04:11+00:00Added an answer on June 11, 2026 at 7:04 am

    Use an onUploadStart handler to set the random string used for the upload.

    $('#file_upload').uploadify({
                'fileObjName': 'file',
                'fileSizeLimit': '8MB',
                'buttonText': 'BROWSE FILE(S)...',
                'fileTypeExts': '*.JPEG; *.GIF; *.PNG; *.APNG; *.TIFF; *.BMP; *.PDF; *.XCF',
                'cancelImg': 'uploadify-cancel.png',
                'swf': 'uploadify.swf',
                'uploader': 'uploadify.php',
                'auto': false,
                'onUploadStart': function() {
                   $("#file_upload").uploadify('settings', 
                                               'formData',
                                               randomString(7, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')) }
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I am trying to restart a service from a php web page. Here
Basically I've made a form in Cakephp 2.1 with a jQuery button that appends
Basically, what I'm trying to create is a page of div tags, each has
Basically what I'm trying to do is make a very simple vertical bullet projectile
Basically, I have a JTextPane to hold some text which I wish to style.
Basically my sign up form is not working. When I sign someone up it
Basically my question is, if I have a number string, and i'm going to
Basically I'm trying to improve on the Ghosts in a Pacman game I'm making.
Basically i'm trying to build a comment system. The user looks at a photo
Basically in my in my aspx page I have a gridview which displays the

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.