File upload

This is a discussion on File upload within the PHP General forums, part of the PHP Programming Forums category; I want to upload some file to my web site. I'm using this script: <html> <head&...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-25-2003
Peda
 
Posts: n/a
Default File upload

I want to upload some file to my web site.

I'm using this script:

<html>
<head>
<title>Upload Form</title>
</head>
<body>
<form action="upload_single.php" method="post"
enctype="multipart/form-data">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="102400">
Upload a file: <input type="file" name="thefile"><br><br>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>


The upload_single.php script is just this:
<?php
$ime = $_FILES["thefile"]["name"];
print ($ime);
?>

I just want for begining to print the name of file.

But It doesn't work.

Operating system is Linux.
Web server is Apache.

Can anyone help me.

Greetings!
Peda.


Reply With Quote
  #2 (permalink)  
Old 07-25-2003
John W. Holmes
 
Posts: n/a
Default Re: [PHP] File upload

Peda wrote:

> I want to upload some file to my web site.

[snip]
> But It doesn't work.


Do you have file uploads enabled in php.ini? Take a look at a phpinfo()
page for details.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com




Reply With Quote
  #3 (permalink)  
Old 07-25-2003
Jonas Thorell
 
Posts: n/a
Default RE: [PHP] File upload

>The upload_single.php script is just this:
><?php
> $ime = $_FILES["thefile"]["name"];
> print ($ime);
>?>


>I just want for begining to print the name of file.


>But It doesn't work.


Do you get anything if you change "name" to
"tmp_name" to beging with? If I'm not mistaken
,"name" isn't filled in with anything unless
You've used move_uploaded_file() first.

Also check if uploads are enabled in php.ini.
Oh, and if you have permissions to write in
The tmp directory as well.

/Jonas

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14


Reply With Quote
  #4 (permalink)  
Old 07-25-2003
Peda
 
Posts: n/a
Default Re: [PHP] File upload

> Do you have file uploads enabled in php.ini? Take a look at a phpinfo()
> page for details.


Yes I have.


Reply With Quote
  #5 (permalink)  
Old 07-25-2003
Sven
 
Posts: n/a
Default Re: File upload

Peda wrote:
> I want to upload some file to my web site.
>
> The upload_single.php script is just this:> <?php
> $ime = $_FILES["thefile"]["name"];
> print ($ime);
>
> I just want for begining to print the name of file.
> But It doesn't work.


did you look what comes from your form? try:
var_export($_FILES);


Reply With Quote
  #6 (permalink)  
Old 07-25-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] File upload


* Thus wrote Peda (ena-mona@eunet.yu):
> I want to upload some file to my web site.
>
> I'm using this script:


Please Read:
http://us3.php.net/manual/en/features.file-upload.php


Curt
--
"I used to think I was indecisive, but now I'm not so sure."
Reply With Quote
  #7 (permalink)  
Old 07-25-2003
Peda
 
Posts: n/a
Default Re: File upload

> did you look what comes from your form? try:
> var_export($_FILES);



It comes the empty array:
array( )


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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:21 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0