Laravel 5.4 bug

If you think there is a Bug with Laravel 5.4 “Swift_IoException in FileByteStream.php line 144: Unable to open file for reading” ; then this article is for you.

If you are trying to send a email with Attachment File , It Work Perfectly when you are using an externale link like :

public function build() 
{ return $this->view('email.test') ->attach("otherwebsite.com/file.pdf"); }

But when you try to send Files that stored on your Storage Folder like :

public function build() 
{ return $this->view('email.test') ->attach("mydomainename.com/storage/file.pdf"); }

, it Thrown an Eroor :

Swift_IoException in FileByteStream.php line 144: Unable to open file for reading

Suppose you had already generated a Storage:LINK , that allow you to access to Storage Folder and i can access to it via url ( mydomainenname.com/storage/file.pdf ) ,

What should you do ?

You’re not showing the code leading to the failure, but from the error messages, it seems as if you were specifying a directory where a file path is needed. Maybe because of a missing variable that is supposed to contain the file name.

You need to supply the full path to uploads not a realtive path because that is going to be interpreted as relative to class file that tries to open your attachment.

Try using realpath before passing the path to Swift. $path = realpath(‘uploads/’) 

If this article helped you , dont forget to share .

How do I skip AdWords first campaign page?Use Google’s AdWords Keyword Planner for Free

10 Websites to check keyword search volume for free

10 COMMENTS

  1. It’s impressive that you are getting thoughts from this
    paragraph as well as from our discussion made at this time.

  2. You can take this content with your own website, or partner with others.
    Rarely unless there is also another perks troubled.

    The effort of Google to try depth from a site should be commended.

  3. You can take this content with your own website, or partner with others.
    Rarely unless there is also another perks troubled. The effort of Google to try depth from a
    site should be commended.

  4. Terrific work! This is the type of info that are meant to be shared across
    the internet. Disgrace on Google for now not positioning this submit higher!
    Come on over and visit my site . Thanks =)

  5. Its like you read my mind! You appear to know so much approximately
    this, such as you wrote the e book in it or something. I feel that you just could do
    with a few % to power the message house a little bit,
    however instead of that, this is excellent blog.

    An excellent read. I will certainly be back. Hi, I do believe this is a great blog.
    I stumbledupon it 😉 I may revisit once again since i have bookmarked
    it. Money and freedom is the greatest way to change, may
    you be rich and continue to help others. I’ve been browsing online
    more than three hours today, yet I never found any interesting article like
    yours. It’s pretty worth enough for me. In my view, if all webmasters and bloggers made good content as you did,
    the internet will be much more useful than ever before.

  6. Pretty part of content. I just stumbled upon your
    website and in accession capital to assert that I acquire in fact enjoyed account your blog posts.
    Anyway I’ll be subscribing to your feeds and even I achievement you access consistently fast.

LEAVE A REPLY

Please enter your comment!
Please enter your name here