Jump to content

Accessing the full file path in PHP form Input type='file'


wongadob

Recommended Posts

I am trying to get the full file and path name from my form using input type file. I do not want the file I just want the link to the file. Yes I know the file can move, but that would be the problem of the user to update. The system I have works as follows. The filepath I need is a link to some documentation that is stored on a shared drive on a server elsewhere in the organisation. Each item that is entered can have a hyperlink to its own documentation. The documentation is put together by another department and can change frequently - Hence I do not want to upload it as it could change and there may be about 1000 records pointing to this document. So in my database I need to store the full path. Of course there is the security risk that this file could become infected, but that risk would be there if they opened it on the desktop just as easily as via a hyperlink to a network drive document. So can it be done. I would rather they did not have to enter the full path by hand so using the input type='file' seems to be the best option. Your thoughts or solutions please Regards Wongadob

Link to comment
Share on other sites

Any suggestions as to the correct way to approach it based on my comments above. The files are situated within the same company. They have many sites offices), but these files are stored on a shared drive. X:/docs for example. A hyperlink needs to be stored within the SQL database for each record so that when a record is opened they can access the document directly. From a client perspective it is no more dangerous than opening the file by directly navigating to the shared drive and opening it. What would the PHP solution be?

Link to comment
Share on other sites

You need to use a text input or something where they copy and paste the filename. If you use a file input the server won't necessarily have access to the full local path, just the actual filename. The file input is not used for transmitting local paths to the server, it is used to upload actual files.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...