# \[PHP\] help with a simple upload script

**URL:** <https://forum.kirupa.com/t/php-help-with-a-simple-upload-script/234018>\
**Category:** programming\
**Created:** [July 29, 2007, 4:10pm UTC](https://forum.kirupa.com/t/php-help-with-a-simple-upload-script/234018 "2007-07-29T16:10:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexGM16](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@AlexGM16](https://forum.kirupa.com/u/AlexGM16)\
**Post date:** [July 29, 2007, 4:10pm UTC](https://forum.kirupa.com/t/php-help-with-a-simple-upload-script/234018/1 "2007-07-29T16:10:25Z")

</div>

Sorry I am very new to PHP and I tried to follow the directions on a simple file uploading script, but I get this error when I submit the form:

**Parse error** : syntax error, unexpected T\_STRING, expecting ‘]’ in **C:\wamp\www\php\do\_upload.php** on line \*\*4

\*\*

```php
<?php
$file_dir = "C:\\wamp\\www\\php\\uploads\\";
 foreach($_FILES as $file_name => $file_array) {
      echo "path: ".$file_array['"tmp_'name"]."<br />
";
      echo "name: ".$file_array[''"name"]."<br />
";
      echo "type: ".$file_array["'type'"]."<br />
";
      echo "size: ".$file_array[''"size"]."<br />
";
 
      if (is_uploaded_file($file_array['"tmp_'name"])) {
        move_uploaded_file($file_array['"tmp_'name"],
           "$file_dir/".$file_array["name"]") or die ("Couldn't copy");
        echo "file was moved!<br />";
    }
 }
 ?>

```

I think I have way too many single quotes, but I’m not sure.
