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

  • Home
  • SEARCH
  • 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 5981623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:58:11+00:00 2026-05-22T21:58:11+00:00

I am using uploadify to allow images upload in a form. The issue i’m

  • 0

I am using uploadify to allow images upload in a form.

The issue i’m having is the following:

To submit the form, the user has to be logged in.
The images, will ideally be uploaded to the path /uploads/

the problem is, the php script that uploadify’s swf connects to doesn’t get the sessions currently active. that means i can’t do

<?php
// this would be the backend script that handles the upload

session_start();
$username = $_SESSION['username'];
$upload_path = "/uploads/$username/";

?>

Now, uploadify allows you to pass $_POST information to the php script in JSON format.

So I could do

scriptData: { username : '<?php echo $_SESSION['username'] ?>'}

in the javascript part and php would receive the variable. But this isn’t secure….someone could just temper with the information and make {username: whatever-he-wants}.

How can I get around this issue?

tl;dr – when using uploadify, how can i use existing $_SESSION variables in the backend script?

  • 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-22T21:58:11+00:00Added an answer on May 22, 2026 at 9:58 pm

    Insecure it is:

    Send the session id with the request and have the server use that session id (if sent).

    When I used a swf uploader, I did that. Something like this:

    if ( !empty($_POST['sess']) ) {
        session_id($_POST['sess']);
    }
    session_start();
    

    And on the page you make the request, you get the session id with:

    <?php echo session_id(); ?>
    

    Should work, but is not very secure either. My advice: don’t use a swf uploader =) HTML5 introduces accept="mimetypes" and multiple as file input attributes. See the specs. If the client doesn’t support HTML5 like this: too bad

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

Sidebar

Related Questions

I'm using uploadify on a page that allows a user to upload images as
So I am using the Uplodify plugin to allow users to upload multiple images
So I'm using uploadify to upload multiple images to a folder. Along with each
I am using Uploadify to Upload the Images. the only glitch i am facing
I'm using Uploadify and Kohana and I'm creating file uploader. User can upload only
I have an asp button that is used to upload images (using uploadify) and
I am using a script to upload photo (written by my own) which allow
I am using the Uploadify Plugin to Upload files. although this might be a
I am using uploadify plugin of jquery and have set multiple files upload to
I am using Uploadify on one of my client's web sites to allow them

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.