Forum Moderators: open

Message Too Old, No Replies

gettting the whole filename from a form field

where is the directory

         

shumboom

1:08 pm on Dec 5, 2008 (gmt 0)

10+ Year Member



Here's my code. My problem is all I want is the whole filename incl the directory so that processing can take place on the client side but cannot find it in the FILES array. All I want is to to allow the user to enter a csv file of email IDs which would then be processed and presented to said user as a list.

Sorry if this is very obvious but I just need someone to point me to right place. Nearly all examples I have seen use uploading to a server which I dont think I want - or do I? Thanks,Shumit

<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>

rocknbil

4:53 am on Dec 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you saying you want to read the user's path from the field "uploadedfile?"

Can't be done, this is a security issue. Imagine if you could read:

C:\\My Documents\my-sensitive-data\myfile.txt

You could potentially use the path to snoop the client computer, very bad. All the browsers supply is the filename from the input type=file.

shumboom

11:39 am on Dec 6, 2008 (gmt 0)

10+ Year Member



Ah I see. Thanks v much.