File Upload Path Question

Hello everyone,

I’m not a pro; therefore, my question might be weird, however, here it is:

I’ve created the file upload field with browse button. Everything is working great, except I cannot get the client-side file path (i.e. C:/My Documents/…/…jpg) to show in the file upload field. I’ve tried different things, however, the best result I get is to show the server-side folder where the file will be uploaded.

Here is the snippet of the code:

[php]
<input name=“fieldset_group_File” type=“file” id=“fieldset_group_File” tabindex=“1” value="<?php echo UploadStatus["UploadResult1"][""]; ?>" size=“30” />[/php]

Any advise would be helpful.

Thank you.

Try using realpath();

http://www.w3schools.com/php/func_filesystem_realpath.asp

Hi TopCoder,

Thank you so much for the reply.

I guess, I’m having the problem with the path in parentheses… If I use the “”, it shows the server-side path, if I do realpath();, it returns empty field…

Here is the modified code:

[php]
<input name=“fieldset_group_File” type=“file” id=“fieldset_group_File” tabindex=“1” value="<?php echo $UploadStatus["UploadResult1"][""]; ?>" size=“30” />[/php]

Sorry for misunderstanding and thank you for your time.

You need to put the URL you want the realpath to inside of realpath

realpath(url);

Now, I’m confused. Should I insert the url to the page where the upload field is? Should it be absolute url or from the site root?

Again, I apologize for missing the point.

If I use the "", it shows the server-side path

Put what ever shows that in the middle and experiment with it.

Sponsor our Newsletter | Privacy Policy | Terms of Service