file format validation

On October 2, 2009, in Javascript, Linux, Tips, Tricks, by Sandeep Verma

Hits: 88  Below is the code to check file type in javascript.. <script type=”text/javascript” language=”javascript”> function isImage(file) { var image    = /\.(jpg|jpeg|bmp|gif|png|jpe)$/i; if (image.test(file)) return true; else return false; } function isAudio(file) { var audio    = /\.(mp3|wav|mid|midi|mp2|ul|ra|m3u|ram|rm)$/i; if (audio.test(file)) return true; else return false; } function isArchive(file) { var archive    = /\.(zip|rar)$/i; if (archive.test(file)) return true; [...]

create sub buckets on amazon s3

On October 2, 2009, in Amazon Cloud EC2 S3, Fedora, LAMP, PHP, Tips, Tricks, Web Services, by Sandeep Verma

Hits: 126  Sub buckets is very tricky task to create on Amazon S3 service… <?php include(“S3.php”); // class for REST based S3 manager $s3 = new S3(‘accessKey’, ‘secretKey’); $s3->putBucket(‘bucketname’, S3::ACL_PUBLIC_READ); /* function to upload svnlabs.txt file to subfolders s/v/n/l/a/b/s on S3 bucketname */ $s3->putObjectFile(‘svnlabs.txt’, ‘bucketname’, ‘s/v/n/l/a/b/s/svnlabs.txt’, S3::ACL_PUBLIC_READ); /* function to delete svnlabs.txt file to subfolders s/v/n/l/a/b/s [...]

wget – server to server files transfer

On October 2, 2009, in Fedora, LAMP, Linux, Tips, Tricks, by Sandeep Verma

Hits: 44  wget is powerful utility in linux. We can use “wget” to download files of any folder on any server to our server. wget will download files on local server in current folder, we can use # pwd (for current directory) # wget -H -r –level=1 -k -p http://www.domain.com/folder/ here level is folder’s level Keep [...]

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...