<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>upload files to web server Archives -</title>
	<atom:link href="https://mitindia.in/tag/upload-files-to-web-server/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/upload-files-to-web-server/</link>
	<description></description>
	<lastBuildDate>Sat, 26 Nov 2016 07:10:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>upload files to web server Archives -</title>
	<link>https://mitindia.in/tag/upload-files-to-web-server/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Upload images to web server using php</title>
		<link>https://mitindia.in/upload-images-to-web-server-using-php/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Wed, 22 Jun 2016 10:42:26 +0000</pubDate>
				<category><![CDATA[PHP-MySQL]]></category>
		<category><![CDATA[upload files to web server]]></category>
		<category><![CDATA[upload images]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=144</guid>

					<description><![CDATA[<p>The following example shows that how to upload and download images / files [.jpeg/.png/.bmp/ .txt/.doc etc] to web server [localhost or remote server] 1. Create a HTML web page as following screen with code. &#60;html&#62; &#60;head&#62; &#60;title&#62;Image/File Uploading Form&#60;/title&#62; &#60;/head&#62; &#60;body background=bg.jpg&#62; &#60;h2&#62;File Upload:&#60;/h2&#62; Select a file to upload: &#60;form action="file_uploader.php" method="post" enctype="multipart/form-data"&#62; &#60;input type="file" name="file" [&#8230;]</p>
<p>The post <a href="https://mitindia.in/upload-images-to-web-server-using-php/">Upload images to web server using php</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The following example shows that how to upload and download images / files [.jpeg/.png/.bmp/ .txt/.doc etc] to web server [localhost or remote server]</p>
<p>1. Create a HTML web page as following screen with code.</p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Image/File Uploading Form&lt;/title&gt;
&lt;/head&gt;
&lt;body background=bg.jpg&gt;
&lt;h2&gt;File Upload:&lt;/h2&gt;
Select a file to upload: &lt;form action="file_uploader.php" method="post"  enctype="multipart/form-data"&gt;
&lt;input type="file" name="file" size="50" /&gt;&lt;br&gt;
&lt;input type="submit" value="Upload File" /&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Output is&#8230;</p>
<p><img fetchpriority="high" decoding="async" class="alignnone" src="http://3.bp.blogspot.com/-WVMGgrZTLes/Vi3wACYX_ZI/AAAAAAAAA60/MjhwuFvXLEU/s1600/upload1.JPG" width="517" height="250" border="0" /><br />
2. Next, create a  PHP file called &#8220;file_uploader.php&#8221; and add following code to in it.</p>
<pre>&lt;html&gt;
&lt;body background=bg.jpg&gt;
&lt;?php
$uploaddir = '/wamp/www/Demo/uploaded/';
$uploadfile = $uploaddir. basename($_FILES['file']['name']);

if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
} else {
    echo "Error in uploading files..!\n";
}
?&gt;
&lt;br&gt;&lt;br&gt;
&lt;hr&gt;
&lt;a href="download.php"&gt;View Uploaded  files  &lt;/a&gt;
&lt;hr&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href="home.php"&gt; &lt;img src="home-button-icon.png"&gt; &lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>3. Click on &#8220;Choose File&#8221; button to browse and select file/image then click on upload.</p>
<p>4. Before running this page, create a folder called &#8220;uploaded&#8221; in the following location.<br />
/wamp/www/Demo/uploaded/</p>
<div>5. Now, Click on &#8220;Choose File&#8221; button to browse and select file/image then click on upload then it will show as following out put.</div>
<div><img decoding="async" class="alignnone" src="http://3.bp.blogspot.com/-sSHE-_t-Od4/Vi3yGT4ktOI/AAAAAAAAA7A/LK7PrjtBz0U/s1600/uploaded.JPG" width="507" height="426" border="0" /></div>
<div></div>
<div>6. Now, to download the files from server / create a following PHP page for the same task.</div>
<div></div>
<div>7. Create File called  &#8220;download.php&#8221; and add following code to it.</div>
<div></div>
<div>
<pre>&lt;html&gt;
&lt;body background=bg.jpg&gt;
&lt;h1&gt;&lt;font color=teal&gt; Download files here &lt;/h1&gt;
&lt;hr&gt;
&lt;?php

$directory = 'uploaded'; 

echo "&lt;table border=1 style='border:6px solid teal' cellpadding=5 cellspacing=6 align=center&gt;";

foreach(glob($directory.'/*.*') as $file) 
{
echo "&lt;tr&gt;";
echo "&lt;td&gt;". $file . '-' . date ("m/d/Y", filemtime($file)). "&lt;/td&gt;";
echo "&lt;td&gt;". '&lt;a href="'.$file.'"&gt;'.$file.' - Size:'.filesize($file).'&lt;/a&gt;'. "&lt;/td&gt;";

echo "&lt;/tr&gt;";
}
echo "&lt;/table&gt;";
?&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href="home.php"&gt; &lt;img src="home-button-icon.png"&gt; &lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
</div>
<div>8. Now run the above page to see below output and one can download any files from server.</div>
<div class="separator"><img decoding="async" class="alignnone" src="http://1.bp.blogspot.com/-MwVFg6IURRk/Vi3zHSxzevI/AAAAAAAAA7M/Rb1LGf0dGFA/s640/download.JPG" width="640" height="331" border="0" /><a href="http://1.bp.blogspot.com/-MwVFg6IURRk/Vi3zHSxzevI/AAAAAAAAA7M/Rb1LGf0dGFA/s1600/download.JPG"><br />
</a><a href="http://1.bp.blogspot.com/-MwVFg6IURRk/Vi3zHSxzevI/AAAAAAAAA7M/Rb1LGf0dGFA/s1600/download.JPG"><br />
</a><br />
That&#8217;s all for now!<br />
keep browsing here for more on PHP examples!</div>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fupload-images-to-web-server-using-php%2F&amp;linkname=Upload%20images%20to%20web%20server%20using%20php" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fupload-images-to-web-server-using-php%2F&amp;linkname=Upload%20images%20to%20web%20server%20using%20php" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fupload-images-to-web-server-using-php%2F&#038;title=Upload%20images%20to%20web%20server%20using%20php" data-a2a-url="https://mitindia.in/upload-images-to-web-server-using-php/" data-a2a-title="Upload images to web server using php"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/upload-images-to-web-server-using-php/">Upload images to web server using php</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
