英文:
How to get the selected filename from file_selector?
问题
我想在使用文件选择器上传文件时显示所选文件的文件名。
通过 state.path,我可以获取包含名称和后缀之间数字的完整路径,就像这样.../accounts-config.5.yaml。
是否可以筛选字符串以获得原始文件名,但这是否是正确方法?
当按钮被按下时,我看到了一个带有原始文件名的通知,表明文件名应该可以在某个地方找到。
可以选择是的,这是正确的方法,或者提示可以代替使用的变量。
欢迎任何提示。
英文:
I want to display the selected filename when using file_selector for uploading a file.
Through state.path I get the full path where the filename has a number between name and suffix like this .../accounts-config.5.yaml.
Possible to filter the string to the original filename but is this the way to go?
I see a notification with the original filename when the button is pushed, indicate the filename should be available somewhere.
Either a yes, this is the way to go or an hint to a variable that could be used instead.
Any hints are welcome.
答案1
得分: 0
如果您想显示文件名,您应该根据路径进行过滤,就像您说的那样。
英文:
If you want to show the filename, you should filter on the path, like you said.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论