File Upload Steps
Home Up C/C++ File Upload Steps JDBC Reference Acronyms FAQ PERL functions



Steps for Writing a file upload form and server side script.

1. Create a file upload form
2. write cgi script for server-side processing.
a. use CGI pm.
b. get the name of file using name of file parameter e.g. $filename = $query->param("photo");
c. remove path separators from it (code = $filename =~ s/.*[\/\\](.*)/$1/;)
d. get its handle (code = open UPLOADFILE, ">$upload_dir/$filename";)
e. open a file on server and get its handle (code = open UPLOADFILE, ">$upload_dir/$filename";)
f. dump data from submitted file fandle to server-side file: while ( <$upload_filehandle> ) { print UPLOADFILE; } )

Search this site for:


Please use this form to communicate any issues/problems with this website or its contents. If you find any content inappropriate for any reason, please let me know. Hit Counter