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

31 COMMENTS

  1. Needed to compose you a bit of note to give many thanks over again with your striking tactics you’ve contributed
    on this site. It is quite seriously generous of people like you to deliver unhampered exactly what
    many people could have sold as an electronic book to earn some bucks
    for their own end, and in particular seeing that you could possibly have done it if
    you ever wanted. The things additionally worked as a great way to recognize that other people have the
    identical eagerness just like my personal own to figure out a lot more
    when it comes to this condition. I’m certain there
    are numerous more enjoyable occasions ahead for people who start reading your website.

  2. I feel that is among the so much vital info for me.
    And i’m satisfied reading your article. However wanna statement on few common things, The website taste is great, the articles is really great
    : D. Good activity, cheers

  3. An interesting discussion is definitely worth comment.
    I do think that you ought to publish more about this topic, it might not be a taboo matter but usually people do not discuss these topics.

    To the next! Many thanks!!

  4. Howdy just wanted to give you a quick heads up.

    The text in your post seem to be running off the
    screen in Ie. I’m not sure if this is a formatting issue or something to
    do with web browser compatibility but I figured I’d post to let you know.
    The design and style look great though! Hope you get the problem solved soon. Thanks

  5. Excellent beat ! I wish to apprentice even as you amend your web
    site, how can i subscribe for a weblog site? The account helped me a applicable deal.

    I have been a little bit familiar of this your broadcast provided vibrant clear concept

  6. Hello! This post could not be written any better!
    Reading through this post reminds me of my old room mate!
    He always kept chatting about this. I will forward
    this page to him. Fairly certain he will have a
    good read. Thanks for sharing!

  7. I’ve often considered turning off the comments on my personal blog. The main reason I haven’t? No joke: my mom enjoys leaving encouraging comments, so I leave them on. But maybe you’ve decided to turn your blog comments off? You have every right to do so.

  8. Hi there! This post could not be written any better! Reading through this post reminds me of my previous
    room mate! He always kept chatting about this. I will forward this write-up to him.

    Fairly certain he will have a good read. Thank you for sharing!

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

  10. 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.

  11. 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.

  12. Hi! I’ve been following your weblog for a long time now
    and finally got the bravery to go ahead and give you
    a shout out from Lubbock Texas! Just wanted to say
    keep up the good work!

  13. Undeniably believe that which you stated. Your favorite
    justification appeared to be on the net the simplest thing to be aware of.
    I say to you, I certainly get annoyed while people think about worries that they
    plainly don’t know about. You managed to
    hit the nail upon the top and defined out the whole thing without having side-effects ,
    people can take a signal. Will probably be back to get more.
    Thanks

  14. 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 =)

LEAVE A REPLY

Please enter your comment!
Please enter your name here