从django filefield获取原始路径

时间:2022-04-24 19:15:53

My django app accepts two files (in this case a jad and jar combo). Is there a way I can preserve the folders they came from?

我的django应用程序接受两个文件(在这种情况下是一个jad和jar组合)。有没有办法保存他们来自的文件夹?

I need this so I can check later that they came from the same path.

我需要这个,所以我可以稍后检查它们是否来自同一条道路。

(And later on accept a whole load of files and be able to work out which came from the same folder).

(后来接受了一整堆文件,并能够找出来自同一文件夹的文件)。

1 个解决方案

#1


I think that is not possible, most browsers at least firefox3.0 do not allow fullpath to be seen, so even from JavaScript side you can not get full path If you could get full path you can send it to server, but I think you will have to be satisfied with file name

我认为这是不可能的,大多数浏览器至少firefox3.0不允许看到完整路径,所以即使从JavaScript方面你也无法获得完整路径如果你可以获得完整路径你可以将它发送到服务器,但我认为你必须满足于文件名

#1


I think that is not possible, most browsers at least firefox3.0 do not allow fullpath to be seen, so even from JavaScript side you can not get full path If you could get full path you can send it to server, but I think you will have to be satisfied with file name

我认为这是不可能的,大多数浏览器至少firefox3.0不允许看到完整路径,所以即使从JavaScript方面你也无法获得完整路径如果你可以获得完整路径你可以将它发送到服务器,但我认为你必须满足于文件名