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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:01:20+00:00 2026-05-26T06:01:20+00:00

Basically I’ve uploaded a text file to my host and I want to edit

  • 0

Basically I’ve uploaded a text file to my host and I want to edit the file and read it with java. I’ve created the permissions for it but im not sure how to do it with Java. This is my code which read/writes locally:

Read:

BufferedReader mainChat = new BufferedReader(new FileReader("./messages/messages.txt"));
String str;
    while ((str = mainChat.readLine()) != null) 
    {
        System.out.println(decrypt.Decrypt(str, salt));
    }
    mainChat.close();

Write:

    FileWriter chatBuffer = new FileWriter("./messages/messages.txt",true);
    BufferedWriter mainChat = new BufferedWriter(chatBuffer);
    mainChat.write(message);
    mainChat.newLine();
    mainChat.flush();
    mainChat.close();

How would I have to modify this to make it work? 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-26T06:01:21+00:00Added an answer on May 26, 2026 at 6:01 am

    I don’t think you can read/write directly to a file on a web server the way you would on a local filesystem. What you’ll probably need to do is:

    1. download the file
    2. open it in the local editor
    3. when it’s saved, automatically re-upload the file

    You can do this all within the editor, and hide this in the app by having it do the download-edit-save-upload in the background. Many text editors will do this by establishing a remote connection similarly, and making the file writing round trip transparent to user.

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

Sidebar

Related Questions

Basically what I want to do it this: a pdb file contains a location
Basically there is a file called 8puzzle.py and I want to import the file
Basically, I have an object that I think should be garbage-collected but it's not.
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I want to know how to set center alignment for a cell using
Basically, I have a JTextPane to hold some text which I wish to style.
Basically I have converted a tab delimited txt file into a list containing a
basically i would like to display .doc file in WWW, i've tried to fetch
Basically I have an IFRAME that contains a given page - I want to
Basically my sign up form is not working. When I sign someone up it

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.