Hej jeg har et problem jeg kan ikke få det her scipt til at virke. Den får fat i serveren. Men den kan ikke få filden ind det rigtigt sted.
Nogen der kan hjælp.
- <head>
- <meta name="Generator" content="Stone's WebWriter 4" />
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>file upload</title>
- </head>
- <?php
- $ftp_server = "Server";
- $ftp_user = "brugernavn";
- $ftp_pass = "Kodeord";
-
- // set up a connection or die
- $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
-
- // try to login
- if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
- echo "Connected as $ftp_user@$ftp_server\n";
- } else {
- echo "Couldn't connect as $ftp_user\n";
- }
-
- // close the connection
- ftp_close($conn_id);
-
- ?>
- <body>
- <?php
- $path = 'URL/spejder2/image/';
-
-
- if(isset($_FILES['file']) && is_uploaded_file($_FILES['file']['tmp_name']))
- {
- $filename = $_FILES['file']['tmp_name'];
- $destination = $path . $_FILES['file']['name'];
- if (file_exists($destination))
- { echo 'File already exists!<br />'; }
- else
- if(move_uploaded_file($filename,$destination))
- { echo 'File uploaded!<br />'; }
- else
- { echo ' ** Failure! ** <br />'; }
- }
-
- ?>
- <form method="post" enctype="multipart/form-data">
- <input type="file" name="file">
- <input type="submit" value="Upload Image" action="thisform">
- </form>
- </body>
- </html>