function loadHeadScript(url) {
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", url);
var head = document.getElementsByTagName("head")[0];
head.appendChild(script);
}
function loadBodyScript(url) {
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", url);
var body = document.getElementsByTagName("body")[0];
body.appendChild(script);
}
function ucfirst(tname)
ucfirst = ""
tname = tname & " "
do while instr(tname, " ")
temp_string = left(tname, instr(tname," " ) -1)
' ucase the first letter
ucfirst = ucfirst & ucase(mid(temp_string, 1,1))
' lcase for rest of word
ucfirst = ucfirst & lcase(mid(temp_string,2)) & " "
tname = right(tname, len(tname) - instr(tname," " ))
loop
'show me what i get
ucfirst = ucfirst & ucase(mid(tname, 1,1))
ucfirst = ucfirst & mid(tname,2)
ucfirst = Trim(ucfirst)
end Function
header("Content-type: application/octet-stream");
// displays progress bar when downloading (credits to Felix ;-))
header("Content-Length: " . filesize('myImage.jpg'));
// file name of download file
header('Content-Disposition: attachment; filename="myImage.jpg"');
// reads the file on the server
readfile('myImage.jpg');
$uploadedImage = new Upload($_FILES['uploadImage']);
if ($uploadedImage->uploaded) {
$uploadedImage->Process('myuploads');
if ($uploadedImage->processed) {
echo 'file has been uploaded';
}
}
desc "Lists all files in a directory"
task :list do
Dir.chdir(C_DIR)
fs = Dir.glob('**/*.JPG')
count, similar_files = 0
initial = 50
fs.each do |f|
if File.file? f
puts "#{count += 1} -> Copying #{f} to #{REMOTE_DIR}"
unless File.exist?("#{REMOTE_DIR}#{f.to_s}")
File.copy(old_file, new_file, verbose => true)
else
similar_files += 1
end
if count == initial
initial += 50
sleep(15)
end
end
end
puts "Number of Similar files: #{similar_files}"
end