Linux Blog

Dealing with the HTML file input limitation of uploading multiple files

Filed under: General Linux — TheLinuxBlog.com at 8:59 am on Thursday, August 28, 2008

Everybody knows how annoying the <input type=”file”> HTML tag is right? Does it make you mad when you have to browse and upload each file individually? Sure you can use JavaScript to add / remove the input boxes, but you still need to browse for each file individually, which if you’re uploading lots of files doesn’t make sense.

Would you like a multiple file uploader like Facebook has? Perhaps more of a simple explorer like interface that will allow you to select multiple files? Possibly previewing them, and perhaps processing them on the client side?

Well, I wouldn’t say it was the easiest thing in the world to implement but there is an open source multiple file uploader that might suit your needs. Since its written in Java, its highly expandable (if you know how or pay a development company or freelancer) and can also be partially configured with JavaScript.

What is this fantastic sounding multiple file uploader you speak of?

Its called jupload and can be downloaded from jupload.sourceforge.net. Don’t let the website fool you because this tool is actually pretty neat.

If any one would like examples on how to use it, just write a blog post linking to me saying how cool it is and how much you need it, offer me cash, comment or participate in this blog, offer me goods / services, give me links from your website or just e-mail me politely asking for help and I’ll see what I can do.

If you don’t like it: start reading the documentation like I did, seriously its not that hard.

Easy script to upload to an ftp server

Filed under: Shell Script Sundays — Kaleb at 11:43 am on Sunday, February 10, 2008

This weeks Shell Script Sunday article is a guest post by Kaleb. Kaleb has been helping me out a by writing for me since I have a project for The Linux Blog that I’d like to complete and can’t dedicate as much time to writing right now. So if you get a chance visit his site and drop some comments.

Hello it’s Kaleb from http://kpstuff.servebeer.com again and today I have come to tell you about a little shell script that I wrote. It’s a script that allows for extremely easy and simple uploads to an ftp server.

The script is actually quite simple utilizing just standard bash scripting along with ncftp which is just an ftp client with some special features. So you need to install ncftp in order to use this script.

Gentoo:

emerge -av ncftp

Arch Linux:

pacman -Sy ncftp

Ubuntu:

apt-get install ncftp

After you install that you need to edit the upload.sh file to fit your needs. There are a few variables you need to change such as your username and password for the server, and the server itself. It is fairly simple to configure.

Set the user variable to your username

user="kaleb"

Set the passwd variable to your password

passwd="kalebspass"

Then you need to set the server variable to your server you want to connect to

server="kpstuff.servebeer.com"

Be sure to not precede the url with something like http:// or ftp://

Finally you should set the default directory on the server for your file to be placed into.

DIR="/home/$user"

Use $user for your username

Also if your system is odd you may need to make sure that /usr/bin/ncftpput exists. if it does not you will need to find out where on your system ncftp is and change the variable FTPCOM to suit your system.

Now all you need to do is run “chmod +x upload.sh” or “chmod 755 upload.sh” to make it executable and you are finished.

Usage for this script is quite simple. all you need to do is:

./upload.sh <FILE>

Making sure to replace FILE with the filename of the file you want to upload

And if you want to temporarily send the file to a different directory then you specified in the file.

./upload.sh <FILE> <DIR>

Remember to replace with the file you want to upload and replace

with the directory you want to upload to.

You can obtain the script at this address http://kpstuff.servebeer.com/~admin/scripts/upload.sh . And that is it thank you very much for your time and I hope that this script helps you out and if not at least gives you ideas.