将符号链接上传到服务器
实际上是否可以上传符号链接并将其保留为符号链接,而不是上传它们指向的文件?
我有一个依赖符号链接的目录结构,我正在寻找一种方法将其发送给没有命令行知识并希望将其上传到服务器的用户。
有没有办法创建符号链接,以便它们可以作为符号链接上传?如果没有,您可以推荐一种方法吗?
谢谢!!!
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试将目录结构
tar
压缩为存档吗?然后,用户可以在另一端解压缩它。Try
tar
-ing the directory structure into an archive? The users can then un-tar
it on the other end.感谢您的回答!
@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.