[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

full path from a browse button (contd ..)

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

650 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