How to Upload Files to Apache2 Webserver
Joined: 30 Jun 2020
Posts: 9
Location: USA, Melbourne
| | | ||||
| | |||||
| I am trying to set upwards Apache2 on my Ubuntu server to take the ability to post client files to a directory on the server. So far the �Choose File� function works. In one case the client chooses a file on his machine the file proper noun appears side by side to the �Choose File button to ostend the client�s pick. Once the file is chosen the client clicks on the �Upload Button�. Here is my problem. When the �Upload Push button� is pressed the server returns: Not Found The requested URL was not institute on this server. The steps I have taken thus far is to: ane. created a target path folder and given permissions to all users (chmod 777) two. installed a post handler script
3. created the html class
Does anyone see what I accept washed incorrect so far ? Is there some additional steps I need to accept ? I am very grateful for any help or suggestions... Last edited by MikeD254 on Wed 01 Jul 'xx 3:57; edited 1 time in full | |||||
Moderator
Joined: xix January 2006
Posts: 7095
Location: Frg, Adjacent to Hamburg
Joined: 30 Jun 2020
Posts: 9
Location: USA, Melbourne
| | |
| | |
| My mistake. I posted the incorrect version of the html form. I have edited my post show the correct version with the path /usr/lib/cgi-bin/upload.php . Thanks for taking time to await this over | |
Moderator
Joined: 19 Jan 2006
Posts: 7095
Location: Germany, Next to Hamburg
| | | ||
| | |||
| The php file should non be in the cgi-bin folder, merely in the same folder / document root as your html file is. What also helps is in the top of the php file
| |||
Joined: thirty Jun 2020
Posts: 9
Location: USA, Melbourne
| | |
| | |
| Thanks. Added the lawmaking yous suggested to the php file. Moved the php file to document root folder. Edited the html file to to reflect the path modify. Restarted Apache2 server. Still getting same result (The requested URL was not found on this server.), with no other error letters displayed. I am stumped...? | |
Moderator
Joined: 19 Jan 2006
Posts: 7095
Location: Germany, Next to Hamburg
Joined: 30 Jun 2020
Posts: 9
Location: USA, Melbourne
| | |
| | |
| Zip in the fault log well-nigh it. Here is the admission log: 192.168.5.140 - - [02/Jul/2020:17:59:34 -0400] "GET /upld.html HTTP/1.1" 200 542 "http://userver/" "Mozilla/five.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.119 Safari/537.36" | |
Joined: 30 Jun 2020
Posts: nine
Location: United states of america, Melbourne
Joined: 27 Jun 2016
Posts: 136
Location: Sch�mberg, Baden-W�rttemberg, Germany
| | |
| | |
| Hello MikeD254, please apply "/upload.php" as class's "activity"-parameter (<grade method="post" activeness="/upload.php"...) and not the consummate physical path "/var/world wide web/html/upload.php". Best regards | |
Joined: 30 Jun 2020
Posts: 9
Location: USA, Melbourne
| | |
| | |
| Success...!! Now the file called uploads to the web server. Simply left with one question. After the file uploads the server displays this : Source=ExtractPage2.jpg Notice: Undefined variable: destination_path in /var/www/html/upload.php on line 9 Where tin I right the "undefined variable" on line 9? | |
Joined: 27 Jun 2016
Posts: 136
Location: Sch�mberg, Baden-Due west�rttemberg, Germany
| | |
| | |
| Howdy, the errormessage is correct equally the variable is not assigned a value before it is used on line 9 with So you lot can either assign a value to $destination_path in the lines before or just delete line 9 Best regards | |
Joined: 30 Jun 2020
Posts: ix
Location: USA, Melbourne
| | |
| | |
| Many thanks to James Bond, and Matthias for taking time to help. All is now working every bit information technology should, and I accept learned a lot. I more question, what is the difference between "Target_path" and "Destination_path" ? Thanks once again for all your aid and guidance. Mike | |
Joined: 27 Jun 2016
Posts: 136
Location: Sch�mberg, Baden-W�rttemberg, Deutschland
| | |
| | |
| Hullo Mike, I don't know the deviation - from PHP's signal of view both are just variables. All-time regards | |
Joined: 30 Jun 2020
Posts: 9
Location: USA, Melbourne
| | |
| | |
| Thanks once again... Mike | |
Source: https://www.apachelounge.com/viewtopic.php?t=8520
0 Response to "How to Upload Files to Apache2 Webserver"
Post a Comment