p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > PHP/MySQL > Beginning PHP
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 26th, 2009, 03:00 AM
Registered User
Points: 58, Level: 1
Points: 58, Level: 1 Points: 58, Level: 1 Points: 58, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
Question problem about not getting the uploadfile address...

This is my code where i am uploading the file and trying to copying it into another direcotry. But i am facing a problem. The problem is that my uploaded file address is lost when i am checking for copying.. Also i need help about "how do i get the name,size and type of the uploading file? Help me please..............

************************************************** **************

<html>
<head>
<title>A file upload script</title>
</head>
<?php
$file_dir = "c:/wamp/tmp"; // this is new copy address.
$fupload = $_POST['fupload'];
echo "<br> printing the upload directory address: $fupload";
if ( isset( $fupload ) )
{
print "path: $fupload<br>\n";
print "name: $fupload_name<br>\n";
print "size: $fupload_size bytes<br>\n";
print "type: $fupload_type<p>\n\n";
if ( $fupload_type == "image/gif" )
{
copy ( $fupload, "$file_dir/$fupload_name") or die ("Couldn't copy");

print "<img src=\"$file_dir/$fupload_name\"><p>\n\n";
}
}
?>
<body>
<form enctype="multipart/form-data" action="<?php print $PHP_SELF?>" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="51200">
<input type="file" name="fupload"><br>
<input type="submit" value="Send file!">
</form>
</body>
</html>

************************************************** ***************
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
array address problem chris1012 Java Basics 3 December 18th, 2007 11:46 AM
Problem with blank fields in Shipping Address radrussell BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 October 5th, 2007 06:44 AM
UpLoadFile leily Pro JSP 1 May 3rd, 2006 12:09 AM
UploadFile Problem tony_j_hug ASP.NET 2.0 Basics 0 November 8th, 2005 06:34 AM
Retreiving IP address & gateway address sjangit VBScript 0 February 3rd, 2004 02:02 PM



All times are GMT -4. The time now is 05:25 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc