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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:46:01+00:00 2026-06-04T02:46:01+00:00

One section of my site allows users to upload files. These files are not

  • 0

One section of my site allows users to upload files. These files are not uploaded to the server that the website is hosted on (let’s say site.com), instead they are uploaded to s1.site.com, s2.site.com etc. These subdomains point to servers on a different IP address than the main server. I am using the Uploadify jQuery plugin for file uploads.

Now, when a user is logged in and uploads a file, I want that uploaded file to appear in their account page under “files”. I’m stuck on what the best way to do this would be.

I can set options for Uploadify to send additional POST data along with the upload. The simple solution would be to just send the username of the user uploading the file along with the file upload, however other users could spoof their username and upload files into other peoples accounts. Not cool. So I need a way to tell what user is uploading the file while stopping username spoofing.

I thought about sending the users session as POST data, kind of like this:

$('#file_upload).uploadify({
    formData : { '<?php echo session_name();?>' : '<?php echo session_id();?>' }
});

But I don’t really know a thing about sessions. CodeIgniter is handling my user logins. Would this work? Could someone explain to me exactly how I’d go about doing this?

Thank you.

  • 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-04T02:46:03+00:00Added an answer on June 4, 2026 at 2:46 am

    I like to do things like use md5 hashing to create a unique Hash Value based on the Username. I do this once the user has created his or her account for the first time. Then I store that hash value in a column called hash_validation.

    Next, I would (upon user login(you use CodeIngiter for this)) create a session variable for the hash value. Then I can check the hash value against the table and the username for security purposes. It’s as simple as ->

    $_SESSION['hash_value'] = $row['hash_validation']; //general example of grabbing the row we created
    

    I like to hide my SESSION values in a div on the page so I can constantly reference them with JavaScript without having to communicate with the server.

    Once we’ve done all the above, we can use the formData method to send over the hash value to the server (without using php like you did above.) Then the server can check the hash value against existing hash values for said username in the table, and if it’s correct, we’ll upload the file.

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

Sidebar

Related Questions

The site I'm creating has one section for non authenticated users and another for
I've built a web site on ASP.NET MVC and one little section of it
On one section of my website, I ask my customers for their postal code
Our website has one section which often changes to match the user. (examples are
A client of mine has a site in wordpress, with one section being a
For some reason the urls in one section of our site were changed from
I have a blogs and questions section on my site that has categories. When
I've got one mysql table with usernames, passwords and property names, that allows a
I'm setting up a horizontally scrolling site, with Index Exhibit. One section needs to
I have an asp.net MVC application that has one section /admin locked down via

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.