Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 从父目录访问图像_Node.js_Express_Parent Child_Pug_Directory Structure - Fatal编程技术网

Node.js 从父目录访问图像

Node.js 从父目录访问图像,node.js,express,parent-child,pug,directory-structure,Node.js,Express,Parent Child,Pug,Directory Structure,我对杰德有个大问题。从我的文件夹结构开始: -root --public ---asdq (<-- the users directories; asdq is just a test user) ----jellyfish.jpg (<-- the image; also just a test) ---www ----member.jade -root --公开的 ---asdq(无图像显示 将我的应用程序中的静态文件夹更改为“/public/www”,然后再次从1和2开始。结

我对杰德有个大问题。从我的文件夹结构开始:

-root
--public
---asdq (<-- the users directories; asdq is just a test user)
----jellyfish.jpg (<-- the image; also just a test)
---www
----member.jade
-root
--公开的
---asdq(无图像显示

  • 将我的应用程序中的静态文件夹更改为“/public/www”,然后再次从1和2开始。结果与之前的方式基本相同

  • 顺便说一句,传递的路径是动态生成的,因为“usedirs”只是用户能够创建的所有目录的占位符

    最大的问题是:我如何访问父文件夹中的图像?我对这个问题非常着迷,因为我的研究总是以“使用“/…/”或“../”来访问父目录”结束。而这根本不起作用


    我希望你能帮忙。谢谢。

    。/userdirs/userimages/file.jpgoh我明白了。。不,不,“userimages”只是实际图像的占位符。。我将编辑此:)