Skip to content

ThirteeNov

My personal blog about coding and internet

Menu
  • About me
  • About Zofia Kreasi
  • Cart
  • Checkout
  • Making an airplane game from scratch in Unity
  • My account
  • Privacy Policy
  • Privacy Policy – zkLeaderboard
  • Sample Page
  • Shop
  • Tutorials on Learning JavaScript
  • ZKAccounts – Privacy Policy
Menu

Make your own WiFi file transfer system – Simple HTML and PHP local file upload script

Posted on August 1, 2023August 1, 2023 by Habibie

Let’s say we have our local webserver, in my case I use XAMPP so I can have a local web in my localhost.

Then, by accessing this local web page over wifi from my mobile phone web browser, I can upload some files from my phone to the local web server.

This way I can send file wirelessly from my phone to my PC just by visiting my local web page.

In case you need something like this, please have this php script in your localhost:

<!DOCTYPE html>
<html>
	<head>
		<title>Uploads</title>
	</head>
	<body>
		
		<?php
		if(isset($_POST['upload'])){
			$target_dir = "uploads/";
			if (!file_exists($target_dir)) {
				mkdir($target_dir);
			}
			
			$target_file = $target_dir . basename($_FILES["userfile"]["name"]);
			move_uploaded_file($_FILES["userfile"]["tmp_name"], $target_file);
			 
			echo "File uploaded!";
		}else{
			?>
			<form method="POST" enctype="multipart/form-data">
				<label>Select File</label>
				
				<input name="userfile" type="file"/>
				<br><br>
				
				<input type="submit" name="upload" value="Upload">
			</table>
			</form>
			<?php
		}
		?>
	
		
	</body>
</html>

Then access it over wifi from your any devices you have, but don’t forget to change the “localhost” with the local server ip address.

To avoid confusion, I will demonstrate it in a video: (coming soon).

Post Views: 433
ciihuy2020

Welcome!

  • My YouTube Channel
  • My GitHub Page
  • About me

Categories

  • 3DVista
  • Android
  • Apache
  • C#
  • Cordova
  • Electron & Node JS
  • HTML5, CSS & JavaScript
  • iOS
  • Let's Make Unity Games
  • Misc
  • Photoshop
  • PHP
  • Python
  • Uncategorized
  • Unity
  • WordPress

Recent Posts

  • Make objects like wires and cables easily in Unity using Ciihuy Curved Mesh
  • [SOLVED] Can’t Add Custom Domain to Blogger After Losing CNAME Verification
  • iOS App Icon Generator by CiihuyCom
  • Advanced Blinking Marker Script to show objects position in your game canvas
  • Ciihuy Images Merger – Fast & Easy Online Image Combiner
© 2025 ThirteeNov | Powered by Superbs Personal Blog theme