Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uploading ZIP's

Status
Not open for further replies.

Siberdude

Programmer
Apr 4, 2000
29
GB
Hey, can anyone tell me how to upload a ZIP file from a cleints comp, via a web page, to a specific folder on my web server??<br>Thanks<br>Siberdude <p>Siberdude<br><a href=mailto:siberdude@settlers.co.uk>siberdude@settlers.co.uk</a><br><a href= - Settlers community site</a><br>16 years old, capable of:<br>
Html, CSS, Javascript, DHTML, Perl, and even a little JAVA<br>
Not that i like to brag :p
 
The server has to support FTP . Then simply using the commands of FTP you can upload FTP provided the permission has to be granted.<br><br>Thanx<br>Siddhartha Singh<br><A HREF="mailto:ssingh@aztecsoft.com">ssingh@aztecsoft.com</A>
 
I think your missing the point. I want to allow my Viisitors to Send the server. Thus eliminating the need for me to manualy upload all the maps i am mailed<br>Thanks <p>Siberdude<br><a href=mailto:siberdude@settlers.co.uk>siberdude@settlers.co.uk</a><br><a href= - Settlers community site</a><br>16 years old, capable of:<br>
Html, CSS, Javascript, DHTML, Perl, and even a little JAVA<br>
Not that i like to brag :p
 
another possibility.....<br><br>with netscape ( I'm sure IE will do it also, but I don't know how)<br>you can point your user to the writable ftp directory (<A HREF="ftp://ftp.some.server.com/pub/" TARGET="_new">ftp://ftp.some.server.com/pub/</A>).<br>Once there, the user can go <b>File-Upload File</b> in the menu.<br>This will allow the user to browse to the local file they want to upload and send it, <br>seemly through the browser, to the ftp server.<br><br>You could call a script via a crontab entry to periodically move any files it finds there.<br><br><br>
 
Hi Siberdude,<br>I have the same problem, and the user named Ati has answered to write a CGI (server) program to solve the problem. I suppose that the server program must download from its side via ftp: I would like to have a confirmation<br>
 
Found a way to use CGI.pm to do it...........this pops a 'browse to the file' dialogue box and lets the user upload the file.&nbsp;&nbsp;A few paths and such have been changed to protect the innocent.<br><br><FONT FACE=monospace>#!/usr/local/bin/perl<br>use CGI;<br>$thisCGI = '/cgi-bin/upload';<br><br>$query = new CGI;<br>print $query-&gt;header,$query-&gt;start_html(-title=&gt;&quot;UPLOAD THIS&quot;);<br>print $query -&gt;start_multipart_form('POST',&quot;$thisCGI&quot;);<br><br>print &quot;Enter or Browse to the file you would like to upload.&lt;BR&gt;\n&quot;;<br>print $query-&gt;filefield(-name=&gt;'fileID',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -size=&gt;50,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -maxlength=&gt;80);<br><br>my $fileID = $query-&gt;param('fileID');<br>@pathName = split(/\\/,$fileID);<br>$newFile = '/where/do/you/want/it/';<br>$newFile .= pop(@pathName);<br><br>if ($fileID)<br>&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp; open(OPF,&quot;&gt;$newFile&quot;) ¦¦ &showError(&quot;Failed to open OPF, $!&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp; while ($bytesread=read($fileID,$buffer,2048)) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ print OPF &quot;$buffer&quot;; }<br>&nbsp;&nbsp;&nbsp;&nbsp; $type = $query-&gt;uploadInfo($fileID)-&gt;{'Content-Type'};<br>&nbsp;&nbsp;&nbsp;&nbsp; print &quot;&lt;BR&gt;Upload of $newFile of type $type Successful&lt;BR&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>print '&lt;BR&gt;',$query-&gt;submit('doWhat','uploadMe');<br>print $query-&gt;end_form;<br>print $query-&gt;end_html;<br><br>sub showError<br>{<br>my @error = @_;<br>print &quot;&lt;CENTER&gt;&lt;font color=\&quot;\#ff4500\&quot;&gt;Fatal ERROR - @error&lt;/font&gt;&lt;BR&gt;\n&quot;;<br>print &quot;Submission aborted - your data was not saved!!&lt;BR&gt;\n&quot;;<br>print &quot;Please use the BACK button to return to the previous page&lt;BR&gt;\n&quot;;<br>print &quot;and correct the error.&lt;BR&gt;&lt;/CENTER&gt;\n&quot;;<br>print $query-&gt;end_form,$query-&gt;end_html;<br>exit;<br>}<br><br></font><br>See the docs for CGI.pm to about checking file types and such......<br><br>'hope this helps. <p> <br><a href=mailto: > </a><br><a href= > </a><br> keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top