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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:04:28+00:00 2026-05-19T03:04:28+00:00

I have been trying to upload a .txt to my server via a simple

  • 0

I have been trying to upload a .txt to my server via a simple php script I made. Everything seems to uploaded correctly, if I open the .txt in Dreamweaver I can see all the formatting is still in tact with spaces and paragraph breaks.

The problem I have is when I try to open that file with PHP and import the contents onto my site. I’m not using an editor right now, just a simple div where the contents are echoed.

I don’t have much experience with uploading/downloading using PHP. Am I not using a command to handle the file contents and keep the initial formatting?

In the end I want the user to upload a file, and have PHP read the file and extract certain elements from it based on the number of spaces between paragraph breaks and such.

I was able to actually echo the .txt using URLENCODE() which kept the formatting and made all my spaces +’s. Thats the closes I got, but the original file isn’t uploaded in the format so I can’t do a count for +’s and select x characters after the last +.

Hmmm, if someone knows of a script already available that can do this or similar to with me just tweaking that would be awesome.

  • 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-19T03:04:29+00:00Added an answer on May 19, 2026 at 3:04 am

    The upload script is not faulty, you forgot that HTML doesn’t respect whitespace. If you want HTML to respect your whitespace in a piece of text wrap it in the <pre> tag or through css:

    white-space: pre;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to resize a bunch of photos that have been previously uploaded via
I have been trying to upload a (zip) file to a remote server programmatically
I have been trying to get a PNG to upload with a clean, 24
I have been trying to design a WCF file upload service and am getting
I am trying to extend the Upload library in CodeIgniter. I have been trying
I have been trying to upload an image using CodeIgniter's File Upload class. The
I have been trying to download Heroku software to upload the rails app I
I have been trying to find a way to upload an image. Well I
I have been trying to execute a selenium.attachFile command to upload a file- sel.attachFile(dom_locator,/home/xyz/Desktop/tstfl.txt);
I have been trying to implement a image upload for changing avatar for individual

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.