Web Analytics Made Easy -
StatCounter Dreamweaver/ Upload Script - CodingForum

Announcement

Collapse
No announcement yet.

Dreamweaver/ Upload Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dreamweaver/ Upload Script

    OK I am at a total loss here and Ive been dealing with this same problem for a week straight now 8hrs a night on google trying to solve it so i REALLLLLY hope someone here can help me out. I have a desktop pc which i turned into a lamp server and everything was fine and dandy. I was happily using the ftp client in Dreamweaver to upload my pages to the server. Then I tested out a script that I have which allows a user to upload files. Ever since i tested that script my dreamweaver ftp wont work. The error it keeps giving me is that my login info is incorrect. Which it is 100% not. I know this because I uninstalled and reinstalled adobe cs5 and after reinstall it worked again however as soon as I used the upload script the Dreamweaver ftp client stopped working again. I cant find anything on any search engine regarding this specific problem. Someone please help !
    -SB

  • #2
    k. first off, if the server is installed locally on your computer, you should not be bothering with FTP, you can save directly to the folder on your local disk.

    in regards to the upload script, without seeing it, we cant really make any guesses.
    - Firebug is a web developers best friend! - Learn it, Love it, use it!
    - Validate your code! - JQ/JS troubleshooting
    - Using jQuery with Other Libraries - Jslint for Jquery/other JS library users

    Comment


    • #3
      Yes we need much more info to be able to try and help.

      As Dan said, what is the purpose of using an ftp client to upload files to your LOCAL? server?? Unless you didn't explain it correctly. Are you indeed uploading files to a remote server as well?

      A LAMP server(that you installed on your machine) is for testing files locally while you are in development stage. In DW, you can define your local server where all your web pages will be saved as well as your remote server: this would be used to define your ftp connection.
      Teed

      Comment


      • #4
        Hey guys thanks for your help so far. Yea i guess i sort of mis-explained my situation. It is a remote server. I just have the server here in my house as opposed to using a hosting service. Here is the upload script that caused all the problems i think.
        here is my upload.html
        Code:
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        </head>
        
        <body>
        <html>
        <head>
        <title>File Upload</title>
        </head>
        <body>
        <form action="upload.php" method="post" enctype="multipart/form-data" />
        	<div>
        	  Choose a file to upload: <br />
        	  <input type="hidden" name="MAX_FILE_SIZE" value="26214400"/>
        	  <input type="file" name="userfile" id="userfile" size="50" />
        	  <br />
        	  <input type="submit" value="Upload File" />
        	</div>
        </form>
        </body>
        </html>
        
        </body>
        </html>
        and upload.php
        Code:
        <html>
        <head>
          <title>Uploading...</title>
        </head>
        <body>
        <h1>Uploading file...</h1>
        <?php
        
        //Check to see if an error code was generated on the upload attempt
          if ($_FILES['userfile']['error'] > 0)
          {
            echo 'Problem: ';
            switch ($_FILES['userfile']['error'])
            {
              case 1:	echo 'File exceeded upload_max_filesize';
        	  			break;
              case 2:	echo 'File exceeded max_file_size';
        	  			break;
              case 3:	echo 'File only partially uploaded';
        	  			break;
              case 4:	echo 'No file uploaded';
        	  			break;
              case 6:   echo 'Cannot upload file: No temp directory specified.';
        	  			break;
              case 7:   echo 'Upload failed: Cannot write to disk.';
        	  			break;
            }
            exit;
          }
        
          // put the file where we'd like it
          $upfile = '/var/www/myfiles/'.$_FILES['userfile']['name'];
        
          if (is_uploaded_file($_FILES['userfile']['tmp_name'])) 
          {
             if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile))
             {
                echo 'Problem: Could not move file to destination directory';
                exit;
             }
          } 
          else 
          {
            echo 'Problem: Possible file upload attack. Filename: ';
            echo $_FILES['userfile']['name'];
            exit;
          }
        
          echo 'File uploaded successfully<br><br>'; 
        
        ?>
        <ul>
        	<li>Sent: <?php echo $_FILES['userfile']['name']; ?> </li>
        	<li>Size: <?php echo $_FILES['userfile']['size']; ?> </li>
        	<li>Type: <?php echo $_FILES['userfile']['type']; ?> </li>
        </ul>
        	<a href="<?php echo "/var/www/myfiles/".$_FILES['userfile']['name']; ?>">
        		Click here to view this file</a>
        
        </body>
        </html>
        Thanks again and I hope you will bare with me until I figure this one out.
        -SB

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎