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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:01:31+00:00 2026-05-31T04:01:31+00:00

i have a file on the server where a user can write something to

  • 0

i have a file on the server where a user can write something to it by using a html form and ajax.

Immediately after he finishes writing and the file is saved, the file gets empty’d.

My problem is if 2 or more users write to the same file.

I need to set some kind of priorities, because i want only one user to write at the time and only after the file gets empty’d then the next user can use it.

Or, if user1 writes to the file and then user2 does the same thing, what happens with the post data from the user2? gets lost or it stays in a q and waits for the file to be ready?

As you can see im a bit confused on how this write and read to file works from this point of view.

All help much appreciated.

thanks

  • 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-31T04:01:32+00:00Added an answer on May 31, 2026 at 4:01 am

    take a look at flock() php function. If you lock file, other scripts will be waiting until you reset the lock.

    Another and most times better way. You can use different filenames for different users based on their sessions. It more scalable.

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

Sidebar

Related Questions

I have to develop a file server service that transfer file form a specified
I'm using PuTTY to access my BSD file server and I have several terminal
I'm using C# 2010 Express. I have created a SQL Server CE database file
I have been working on designing a file server that could take the load
I have a file on a Windows 2003 server which is locked by a
I have a file foo.bar.1 on my server and when I try to access
I have a file called error.log on my server that I need to frequently
I currently have a file abc.htm in my Custom Server Control Project and it's
I have a client and server, client sending file to server. When i transfer
In our FreeBSD-environment where we have one server that acts as a file-server, we

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.