Solved

full path from a browse button (contd ..)

Posted on 2008-09-30
2
604 Views
Last Modified: 2013-12-13
Hi,

1)    I was suggested by this forum to use swfupload to get full directory name from a path. My php guy is not on his seat and i need to deliver this so , how is it possible to use this to get the full path (directory) from a browse button and send it to the back end.

2)    I found a piece of code which would display the directory name. How is it possible to send this information to another page.

BRgds,

kNish
<html>
<head>
<title>Return file directory</title>
<script language="JavaScript">
 function GetDirectory() {
  strFile = document.MyForm.MyFile.value;
  intPos = strFile.lastIndexOf("\\");
  strDirectory = strFile.substring(0, intPos);
  alert(strFile + '\n\n' + strDirectory);
  return false;
 }
</script>
</head>
<body>
<form name="MyForm">
<input type="file" name="MyFile">
<input type="button" value="Get directory" onClick="GetDirectory();">
</form>
</body>
</html>

Open in new window

0
Comment
Question by:eyeqube
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
crush83 earned 125 total points
ID: 22604670
You could send it to another page in $_SESSION or in the query string and retrieve it with $_GET. For example, direct user to a link like this:

http://www.yourdomain.com/yourpath?dir=thedir

Then use $_GET['dir'] to retrieve the value of dir, where 'thedir' would be dynamically inserted by your getDirectory() Javascript function.
0
 

Author Comment

by:eyeqube
ID: 22612321
Hi,

         I have it fixed for now. I find that the method="GET" works where sometimes "POST" would not work. Is that possible. How do i ensure that the post work's coz i know GET definitely works.

BRgds,


kNish
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question