0

I am using Uploadify jQuery plugin for file upload.Here there is no browse button used. it will upload the file using ajax on click event.So There is no file temp path is displaying.So i want to make it display.

So, I try to get file temp path using $_FILES['uploadfile']['tmp_name']. But it just return something like this /tmp/phpclqHXj.But i want display actual temp path like C:\Users\Diamantino\Desktop\file.jpg.Can i get this using php. any option in uploadify plugin, anyway to get jquery or js.Any help would be appreciated.

My Browse button. enter image description here

Thanks

4
  • Related, though not really a duplicate: stackoverflow.com/questions/2427936/… Commented Aug 20, 2011 at 4:54
  • You need to display path on page? Or you need it in PHP script? Commented Aug 20, 2011 at 4:55
  • @Timur: I want it display in my page. not php.if possible in php i return it from ajax page.if possible in jquery i will use it directly on my page Commented Aug 20, 2011 at 5:08
  • @gowri, Uploadify displays the name of selected files. You need full path instead? It is may be under some security restrictions Commented Aug 20, 2011 at 5:22

2 Answers 2

1

There is no way to get the full path to the file from your user's computer. You can get the file name (in your example that would be "file.jpg") using $_FILES['uploadfile']['name']. Security issues would arise if you could get information about your user's local folder structure when they upload a file, so web browsers are very unlikely to send that data. If there is some browser that does send it, it won't appear in the $_FILES superglobal, nor will there be any other easy way to access is in php.

Sign up to request clarification or add additional context in comments.

Comments

1

At the very least, you're looking for the filename found under:

$_FILES['uploadfile']['name']

Instead of C:\Users\Diamantino\Desktop\file.jpg, this will return the filename: file.jpg

However, with the use of simple Javascript, you may be able to accomplish getting the entire file path. With some logic on your end, you may be able to get the file path only when the file is uploaded. Here is an example, and some clarity on implementation.

1 Comment

:i'm not looking for file name.looking for only full temp path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.