将符号链接上传到服务器

发布于 2024-08-04 16:50:28 字数 171 浏览 5 评论 0原文

实际上是否可以上传符号链接并将其保留为符号链接,而不是上传它们指向的文件?

我有一个依赖符号链接的目录结构,我正在寻找一种方法将其发送给没有命令行知识并希望将其上传到服务器的用户。

有没有办法创建符号链接,以便它们可以作为符号链接上传?如果没有,您可以推荐一种方法吗?

谢谢!!!

Is it actually possible to upload symlinks and keep them as symlinks as opposed to uploading the files they're pointing to?

I have a directory structure that relies on symlinks and I'm looking for a way to send this to users who have no command line knowledge and would want to upload it to their servers.

Is there a way to create symlinks so that they're uploadable as symlinks? If not, is there an approach you could recommend?

Thanks!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

雨夜星沙 2024-08-11 16:50:28

尝试将目录结构tar压缩为存档吗?然后,用户可以在另一端解压缩它。

Try tar-ing the directory structure into an archive? The users can then un-tar it on the other end.

忆沫 2024-08-11 16:50:28

感谢您的回答!

@Dav 是的,这绝对是我的意思!我仍然需要上传目标文件

@pavium,尽管你有一个观点:需要命令行来解压上传的文件...,但我仍然会研究它,因为它提供了一个打包解决方案,

但我可能已经找到了另一个解决方案,看来 PHP 可以使用 symlink() 函数来处理这项工作,这可以证明非常方便,因为我所有的符号链接都是相对的而不是绝对的,这意味着我可以在服务器上创建符号链接,而不需要特定的服务器信息。

thanks for the answers!

@Dav yes, that's definitely what I meant! I still need to upload the targeted files

@pavium you have a point though re: needing the command line to untar the uploaded file... , still i will look into it as it provides a packaging solution

I may have found another solution though, it seems PHP could handle the job with the symlink() function which could prove quite handy as all my symlinks are relative not absolute, meaning I could possibly create symlinks on the server without the need of a specific server information.

扛起拖把扫天下 2024-08-11 16:50:28
rsync -avlzp /path/to/folder user@somemachine:/path/to/new/folder
rsync -avlzp /path/to/folder user@somemachine:/path/to/new/folder
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文