diff --git a/Changelog.md b/Changelog.md
index d139935..f792512 100755
--- a/Changelog.md
+++ b/Changelog.md
@@ -11,6 +11,7 @@
  - Added some more stats to the dev help page (#97)
  - Added the time taken to search to the search results page (#97)
  - Added support for unicode characters in page names (#95)
+ - Autofill the name box on the file upload page when a new file is selected (#101)
 
 ## Changed
  - Made the background of tags slightly lighter (#91)
diff --git a/build/index.php b/build/index.php
index e9973aa..815e316 100755
--- a/build/index.php
+++ b/build/index.php
@@ -1244,7 +1244,7 @@ class page_renderer
 				switch($item)
 				{
 					//keywords
-					case "user-status":
+					case "user-status": // Renders the user status box
 						if($env->is_logged_in)
 						{
 							$result .= "<span class='inflexible'>" . self::render_username($env->user) . " <small>(<a href='index.php?action=logout'>Logout</a>)</small></span>";
@@ -1254,15 +1254,15 @@ class page_renderer
 							$result .= "<span><a href='index.php?action=login&returnto=" . rawurlencode($_SERVER["REQUEST_URI"]) . "'>Login</a></span>";
 						break;
 
-					case "search": // Displays a search bar
+					case "search": // Renders the search bar
 						$result .= "<span class='inflexible'><form method='get' action='index.php' style='display: inline;'><input type='search' name='page' list='allpages' placeholder='Type a page name here and hit enter' /><input type='hidden' name='search-redirect' value='true' /></form></span>";
 						break;
 
-					case "divider": // Displays a divider
+					case "divider": // Renders a divider
 						$result .= page_renderer::$nav_divider;
 						break;
 
-					case "menu":
+					case "menu": // Renders the "More..." menu
 						$result .= "<span class='inflexible nav-more'><label for='more-menu-toggler'>More...</label>
 <input type='checkbox' class='off-screen' id='more-menu-toggler' />";
 						$result .= page_renderer::render_navigation_bar($nav_links_extra, [], "nav-more-menu");
@@ -2734,16 +2734,23 @@ register_module([
 		<p>$settings->sitename currently supports uploading of the following file types: " . implode(", ", $settings->upload_allowed_file_types) . ".</p>
 		<form method='post' action='?action=upload' enctype='multipart/form-data'>
 			<label for='file'>Select a file to upload.</label>
-			<input type='file' name='file' />
+			<input type='file' name='file' id='file-upload-selector' />
 			<br />
 			<label for='name'>Name:</label>
-			<input type='text' name='name'  />
+			<input type='text' name='name' id='file-upload-name'  />
 			<br />
 			<label for='description'>Description:</label>
 			<textarea name='description'></textarea>
 			<p class='editing_message'>$settings->editing_message</p>
 			<input type='submit' value='Upload' />
-		</form>"));
+		</form>
+		<script>
+			document.getElementById('file-upload-selector').addEventListener('change', function() {
+				var newName = event.target.value.substring(event.target.value.lastIndexOf(\"\\\\\") + 1, event.target.value.lastIndexOf(\".\"));
+				console.log('Changing content of name box to:', newName);
+				document.getElementById('file-upload-name').value = newName;
+			});
+		</script>"));
 					
 					break;
 				
@@ -5266,8 +5273,11 @@ class PeppermintParsedown extends ParsedownExtra
 			if($param3 !== false && strtolower(trim($param3)) == "caption")
 				$imageCaption = true;
 			
+			//echo("Image url: $imageUrl, Pageindex entry: " . var_export(isset($pageindex->$imageUrl), true) . "\n");
+			
 			if(isset($pageindex->$imageUrl) and $pageindex->$imageUrl->uploadedfile)
 			{
+				//echo("Found pageindex entry: "); var_dump($pageindex->$imageUrl->uploadedfile);
 				// We have a short url! Expand it.
 				$imageUrl = "index.php?action=preview&size=" . max($imageSize["x"], $imageSize["y"]) ."&page=" . rawurlencode($imageUrl);
 			}
diff --git a/core.php b/core.php
index f53f744..93ee0fe 100644
--- a/core.php
+++ b/core.php
@@ -943,7 +943,7 @@ class page_renderer
 				switch($item)
 				{
 					//keywords
-					case "user-status":
+					case "user-status": // Renders the user status box
 						if($env->is_logged_in)
 						{
 							$result .= "<span class='inflexible'>" . self::render_username($env->user) . " <small>(<a href='index.php?action=logout'>Logout</a>)</small></span>";
@@ -953,15 +953,15 @@ class page_renderer
 							$result .= "<span><a href='index.php?action=login&returnto=" . rawurlencode($_SERVER["REQUEST_URI"]) . "'>Login</a></span>";
 						break;
 
-					case "search": // Displays a search bar
+					case "search": // Renders the search bar
 						$result .= "<span class='inflexible'><form method='get' action='index.php' style='display: inline;'><input type='search' name='page' list='allpages' placeholder='Type a page name here and hit enter' /><input type='hidden' name='search-redirect' value='true' /></form></span>";
 						break;
 
-					case "divider": // Displays a divider
+					case "divider": // Renders a divider
 						$result .= page_renderer::$nav_divider;
 						break;
 
-					case "menu":
+					case "menu": // Renders the "More..." menu
 						$result .= "<span class='inflexible nav-more'><label for='more-menu-toggler'>More...</label>
 <input type='checkbox' class='off-screen' id='more-menu-toggler' />";
 						$result .= page_renderer::render_navigation_bar($nav_links_extra, [], "nav-more-menu");
diff --git a/module_index.json b/module_index.json
index 7243672..f9d7f01 100755
--- a/module_index.json
+++ b/module_index.json
@@ -77,7 +77,7 @@
         "author": "Starbeamrainbowlabs",
         "description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.",
         "id": "feature-upload",
-        "lastupdate": 1471874150,
+        "lastupdate": 1471882985,
         "optional": false
     },
     {
@@ -203,7 +203,7 @@
         "author": "Emanuil Rusev & Starbeamrainbowlabs",
         "description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation, and also *requires* write access to the disk on first load.",
         "id": "parser-parsedown",
-        "lastupdate": 1471860869,
+        "lastupdate": 1471880277,
         "optional": false
     }
 ]
\ No newline at end of file
diff --git a/modules/feature-upload.php b/modules/feature-upload.php
index ae711a0..418f7be 100644
--- a/modules/feature-upload.php
+++ b/modules/feature-upload.php
@@ -58,16 +58,23 @@ register_module([
 		<p>$settings->sitename currently supports uploading of the following file types: " . implode(", ", $settings->upload_allowed_file_types) . ".</p>
 		<form method='post' action='?action=upload' enctype='multipart/form-data'>
 			<label for='file'>Select a file to upload.</label>
-			<input type='file' name='file' />
+			<input type='file' name='file' id='file-upload-selector' />
 			<br />
 			<label for='name'>Name:</label>
-			<input type='text' name='name'  />
+			<input type='text' name='name' id='file-upload-name'  />
 			<br />
 			<label for='description'>Description:</label>
 			<textarea name='description'></textarea>
 			<p class='editing_message'>$settings->editing_message</p>
 			<input type='submit' value='Upload' />
-		</form>"));
+		</form>
+		<script>
+			document.getElementById('file-upload-selector').addEventListener('change', function() {
+				var newName = event.target.value.substring(event.target.value.lastIndexOf(\"\\\\\") + 1, event.target.value.lastIndexOf(\".\"));
+				console.log('Changing content of name box to:', newName);
+				document.getElementById('file-upload-name').value = newName;
+			});
+		</script>"));
 					
 					break;
 				
diff --git a/modules/parser-parsedown.php b/modules/parser-parsedown.php
index 0b6c20b..43d2c8d 100644
--- a/modules/parser-parsedown.php
+++ b/modules/parser-parsedown.php
@@ -451,8 +451,11 @@ class PeppermintParsedown extends ParsedownExtra
 			if($param3 !== false && strtolower(trim($param3)) == "caption")
 				$imageCaption = true;
 			
+			//echo("Image url: $imageUrl, Pageindex entry: " . var_export(isset($pageindex->$imageUrl), true) . "\n");
+			
 			if(isset($pageindex->$imageUrl) and $pageindex->$imageUrl->uploadedfile)
 			{
+				//echo("Found pageindex entry: "); var_dump($pageindex->$imageUrl->uploadedfile);
 				// We have a short url! Expand it.
 				$imageUrl = "index.php?action=preview&size=" . max($imageSize["x"], $imageSize["y"]) ."&page=" . rawurlencode($imageUrl);
 			}
