473,503 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with browsing for files

36 New Member
Hey

I have a php script which has a browse button that lets the user pick the file. Once the file is picked it redirects to the same page outputting the name of the file picked as a string. The problem I am having is that the name of the file is not being printed to the screen. Can someone take a look to see wuts wrong with it?
Thanks

[PHP]<html>
<body>

<form enctype="multipart/form-data" action="browse.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="submit" />
</form>

<?php
echo("<br>This is browse.php<br>");

$file_name = $_REQUEST['uploadedfile'];

echo("<br>This is the file that is selected (string)$file_name");
?>


</body>
</html>
[/PHP]
Mar 27 '08 #1
1 1032
Markus
6,050 Recognized Expert Expert
Files arent passed through the POST or GET arrays, instead they are passed through the special FILES array.

If you havent read a tutorial on file upload i suggest you take a look at one.

The name of the file resides in the ['name'] key:
[php]
$file_name = $_FILES['uploadedfile']['name'];
[/php]
Mar 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5278
by: Joel Goldstick | last post by:
I wanted to write a simple page to let me choose a directory and then list the files in it. The end goal was to make an easy way to copy all the file names in a directory. I tested with Opera7,...
3
2552
by: Stephen Green | last post by:
I'm using the code found at http://support.microsoft.com/?kbid=224364 called Creating a Directory Browsing Page Using ASP. The code works fine. I would like to find a way NOT to show hidden...
0
964
by: Alan Cobb | last post by:
Hi, I have a VS2003 solution that includes CSharp (CS), managed C++ (MCPP) and unmanaged C++ (UMCPP) projects. It's unclear to me how integrated the source browsing is supposed to be for all...
1
1286
by: Nut Cracker | last post by:
Hello, If anyone can point me to a good ASP based Control Panel for IIS5, I would be much obliged. I hacked together an ASP site for file uploads and sharing. Its very simple, and basically...
4
6183
by: | last post by:
I have earlier used an HttpModule that did URL rewrites on the BeginRequest event. Now I am trying to use the same module in a different application on a new and upgraded machine (winxp sp2). ...
6
9015
by: John Grandy | last post by:
Does how to delete all of IE's browing history from the command line ? Same as Tools Internet Options Browsing History Delete Delete all... What I'd like is a .bat file.
2
1956
by: mc | last post by:
I'm using VS.NET 2005 to create C# asp.net web applications. During deveopment and debugging 9using the "ASP.NET Development Server"), a number of .TMP files are created they have been for Class...
2
3047
by: Joe Kovac | last post by:
Hi! I have a Web Site, where I turned directory browsing off. I want only one sub folder to be browsable: e.g. MyApp/Files/... How do I do that? Any setting in the web.config? Thanks Joe
22
1963
by: Ramon F Herrera | last post by:
My goal is to study (in the RMS sense) and familiarize myself with some OSS code, until I reach the point at which I can make non-trivial modifications to it. The class of applications I have in...
1
2490
by: evenlater | last post by:
I have an Access 2007 application running on a terminal server. One of the features of the app is a wizard that allows them to create an Excel spreadsheet by querying the Access data. When they...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.