download config
This commit is contained in:
		
							parent
							
								
									18b5d0ff20
								
							
						
					
					
						commit
						bdabb94448
					
				| @ -1,2 +1,2 @@ | ||||
| <a href="set1.php" target="main">General</a> - <a href="set2.php" target="main">SAB/Couch/Sick</a> - <a href="set3.php" target="main">Others</a> - <a href="set4.php" target="main">Drive Space</a> - <a href="set5.php" target="main">RSS/Server Statuses</a> - <a href="PicUpload.html" target="main">Picture Upload</a> - <a href="/../ManUpdate.php" target="main">Manual Update</a> | ||||
| <a href="set1.php" target="main">General</a> - <a href="set2.php" target="main">SAB/Couch/Sick</a> - <a href="set3.php" target="main">Others</a> - <a href="set4.php" target="main">Drive Space</a> - <a href="set5.php" target="main">RSS/Server Statuses</a> - <a href="PicUpload.html" target="main">Picture Upload</a> - <a href="/../ManUpdate.php" target="main">Manual Update</a> - <a href="/../download.php" target="main">Download Config File</a> | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										22
									
								
								download.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								download.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | ||||
| <?php | ||||
|     // Fetch the file info.
 | ||||
|     $filePath = 'config.php'; | ||||
| 
 | ||||
|     if(file_exists($filePath)) { | ||||
|         $fileName = basename($filePath); | ||||
|         $fileSize = filesize($filePath); | ||||
| 
 | ||||
|         // Output headers.
 | ||||
|         header("Cache-Control: private"); | ||||
|         header("Content-Type: application/stream"); | ||||
|         header("Content-Length: ".$fileSize); | ||||
|         header("Content-Disposition: attachment; filename=".$fileName); | ||||
| 
 | ||||
|         // Output file.
 | ||||
|         readfile ($filePath);                    | ||||
|         exit(); | ||||
|     } | ||||
|     else { | ||||
|         die('The provided file path is not valid.'); | ||||
|     } | ||||
| ?>
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user