0

my requirement is this :

" When users uploaded one file say "sample.tex" then i need to find the same name PDF file in that directory once he upload the "sample.tex". so file name should be "sample.pdf". we have one form that contain two input file fields.. check the image for reference.

http://img40.imageshack.us/i/proofbb.png/

once user upload the first file and click the "Show Author Email(s)" then i need to find another file "sample.pdf" in the same path and put in below file field. Is that possible in PHP or JQUERY or watever... not only PHP Even Java is also fine. Please help me to find the solution.

Regards Dipen

2 Answers 2

2

You cannot do that with plain JavaScript. You can't even obtain the path information from your "first file"; all the browser will tell you is the plain file name (that is, the file name without any path information). You also cannot force a "file" input field to be set to a value.

You might be able to do this by creating a signed Java applet, but that's a whole different enchilada and you'd pretty much have to make the whole form be a Java thing.

(There's nothing you can do from PHP, as all the server will get is the plain filename and no path information at all.)

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

2 Comments

Thanks bro.. Do you have any Java applet thing related to this. if so please share with me..
@Dipen sorry, no; it's been over 12 years since I even thought about writing a Java applet :-)
0

Let the user do it. Use uploadify with multiple simultaneous uploads enabled. So simple.

2 Comments

Thanks for your reply buddy.. but my requirement is after upload the one file i need to find out another file automatically based on the name of the first file..USer will choose only one file.. that is the important thing here
I think it would be a rather large security risk to allow php/javascript to automatically grab a file from your computer without you knowing.

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.