file not found exception when reading file from Linux EXTREME VPS

后端 未结 1 325
小蘑菇
小蘑菇 2021-01-29 13:09

i am storing images on Linux EXTREME VPS using java

when i store it on server path i\'m getting is

/var/sentora/hostdata/campusguru/public_html/resource         


        
相关标签:
1条回答
  • 2021-01-29 13:43

    I think that the problem is that you are using the wrong file path.

    You say that you are reading a files on a Linux server, and it seems that you are trying to read them on a Windows machine. From this I infer that you have mounted the Linux file server on your Windows machine as an SMB file share ... or something like that1.

    However ... the path that you are using looks like a Linux file path:

    • The path separator is /.
    • The path starts with "/var/..." which is a common convention for UNIX / Linux systems.

    But if you have remote mounted the Linux file system, the file path that you should use is the file path that you would use from the Windows command prompt. Probably starting with a drive letter.

    (I can't tell you what it should be. It depends on how you mounted the file system, and how the remote file server exports the file tree.)


    1 - On the other hand, you may just be using some code you found on the internet which could be completely inappropriate to the task you are trying to do.

    0 讨论(0)
提交回复
热议问题