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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:38:52+00:00 2026-05-21T11:38:52+00:00

Why wont my filesize() method work? My path works for the fread() and file()

  • 0

Why wont my filesize() method work? My path works for the fread() and file() methods, but it wont acknowledge the path on filesize(). Why not? What should my correct path be?

<?php     
    $strLessonDescription = fopen("http://nova.umuc.edu/~ct386a28/lovej2ee/exercise5/content/lesson5.txt", "r") 
                            or die ("Error - lesson5.txt cannot be opened");
    $lessonDescription = fread($strLessonDescription, 
                               filesize("http://nova.umuc.edu/~ct386a28/lovej2ee/exercise5/content/vocabulary5.txt"));
    fclose($strLessonDescription);

    echo $lessonDescription;        
    $arrLessonVocabulary = array();
    $arrLessonVocabulary = file("http://nova.umuc.edu/~ct386a28/lovej2ee/exercise5/content/vocabulary5.txt");

    if (arrLessonVocabulary == NULL)
        print "Error - vocabulary5.txt cannot be opened";
?>
  • 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-21T11:38:53+00:00Added an answer on May 21, 2026 at 11:38 am

    Since the file you’re trying to read is via a remote request, rather than local file, it significantly changes how you want to read that data. Per the fread() manual page, you need to read the file in chunks. Alternatively, try using file_get_contents() which should simplify your code:

    $lessonDescription = file_get_contents('http://nova.umuc.edu/~ct386a28/lovej2ee/exercise5/content/vocabulary5.txt');
    echo $lessonDescription;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why wont this work in IE 7? Any help would be greatly appreciated! http://www.k-e-w-l.ca/slideToggle.php
I can't figure out why the following wont work, any ideas?? public interface IFieldSimpleItem
This just won't work. The problem is that I do not know enough to
<?php if (count($_POST)) { $userfile = $_FILES['userfile']['name']; $file_size = $_FILES['userfile']['size']; $file_temp = $_FILES['userfile']['tmp_name']; $path
Hello everyone I been trying get php uploader working but having a lot of
I'm wont to work with netbeans, and with Visual studio I can't find the
Why wont .style.top = 200px; work in this code? Calling the event within the
I'm trying to add a file upload script in php to a website I'm
Jquery UI autocomplete wont work,what could be wrong?Here is the code.Thank you <head> <meta
<?php if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) { $dbhost = 'localhost'; $dbuser = 'zuk1_boo'; $dbpass

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.