dotkpay Posted July 16, 2010 Share Posted July 16, 2010 I have an html file where users can browse a file whose contents are imported to a mysql database by a php file. I use file as the input type (input type='file') for the brwse field. But when I specify a file and click the submit button, only the file name is seen by the php file; For example if I browse C:\file.txt only file.txt will be recieved and not the whole path. Other than the encoding type for the html form, what could be the problem? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/207944-input-typefile/ Share on other sites More sharing options...
kenrbnsn Posted July 16, 2010 Share Posted July 16, 2010 Please post your form and the PHP script. Ken Quote Link to comment https://forums.phpfreaks.com/topic/207944-input-typefile/#findComment-1087048 Share on other sites More sharing options...
PFMaBiSmAd Posted July 16, 2010 Share Posted July 16, 2010 That's the way it is designed to work. And as far as the server is concerned, it does not matter what the actual path is on the client was, why do you care if you only get the filename? Quote Link to comment https://forums.phpfreaks.com/topic/207944-input-typefile/#findComment-1087051 Share on other sites More sharing options...
dotkpay Posted July 16, 2010 Author Share Posted July 16, 2010 I need the whole path so that I can browse and open a file on the desktop without having to upload it to my webserver. Quote Link to comment https://forums.phpfreaks.com/topic/207944-input-typefile/#findComment-1087061 Share on other sites More sharing options...
kenrbnsn Posted July 16, 2010 Share Posted July 16, 2010 Unless your server is running on your windows box, you can't do that with PHP. Ken Quote Link to comment https://forums.phpfreaks.com/topic/207944-input-typefile/#findComment-1087063 Share on other sites More sharing options...
PFMaBiSmAd Posted July 16, 2010 Share Posted July 16, 2010 That makes no sense. If you have a form with a input type='file' field, the intent of that is to upload the file to the web server that the form submits to. If you are just browsing files on your computer for use on your computer, you would not be using a form in a browser. Quote Link to comment https://forums.phpfreaks.com/topic/207944-input-typefile/#findComment-1087064 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.