dongxian8048 2017-03-30 09:21
浏览 381

在laravel中的公共文件夹中获取图像路径

I'm making direction using this method to upload my image

 mkdir(public_path().'/website/'.$path,0777, true);

It's supposed to create it on the root folder (Public_html) , but i found it created on new folder with name (public ) , so now i can't get the path of the image using this code

 <img src="{{url('public/website/'.$file->path.$file->file)}}"  />

how to get the correct path of the image or even create the folder on the public_html root path ?

  • 写回答

5条回答 默认 最新

  • duanqiao1947 2017-12-18 13:14
    关注

    I didn't tested it but... did you have tried this way?

    mkdir(public_path('/website/'.$path),0777, true);
    

    To me, if I'm not wrong your problem could be only a matter of writing.

    评论

报告相同问题?

悬赏问题

  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题