?
Solved

full path from a browse button (contd ..)

Posted on 2008-09-30
2
Medium Priority
?
608 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 375 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

764 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