•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 391,552 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,576 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:
Views: 6174 | Replies: 1
![]() |
•
•
Join Date: May 2006
Location: Calpines, California
Posts: 25
Reputation:
Rep Power: 3
Solved Threads: 1
I've found a script that does almost exactly what I need but it uses PHP - I know nothing about PHP. Anyone here want to help me convert the PHP to Coldfusion? It's not a whole lot of code. Here's a demo and the source code is below the demo:
http://www.air4web.com/files/upload/
http://www.air4web.com/files/upload/
•
•
Join Date: May 2006
Location: Calpines, California
Posts: 25
Reputation:
Rep Power: 3
Solved Threads: 1
Perhaps someone could just help me convert the PHP line below from PHP to Coldfusion and that would be a good start.
<?php
$ftmp = $_FILES['image']['tmp_name'];
$oname = $_FILES['image']['name'];
$fname = 'upload/'.$_FILES['image']['name'];
if(move_uploaded_file($ftmp, $fname)){
?>
<html><head><script>
var par = window.parent.document;
var images = par.getElementById('images');
var imgdiv = images.getElementsByTagName('div')[<?=(int)$_POST['imgnum']?>];
var image = imgdiv.getElementsByTagName('img')[0];
imgdiv.removeChild(image);
var image_new = par.createElement('img');
image_new.src = 'resize.php?pic=<?=$oname?>';
image_new.className = 'loaded';
imgdiv.appendChild(image_new);
</script></head>
</html>
<?php
exit();
}
?><html><head>
<?php
$ftmp = $_FILES['image']['tmp_name'];
$oname = $_FILES['image']['name'];
$fname = 'upload/'.$_FILES['image']['name'];
if(move_uploaded_file($ftmp, $fname)){
?>
<html><head><script>
var par = window.parent.document;
var images = par.getElementById('images');
var imgdiv = images.getElementsByTagName('div')[<?=(int)$_POST['imgnum']?>];
var image = imgdiv.getElementsByTagName('img')[0];
imgdiv.removeChild(image);
var image_new = par.createElement('img');
image_new.src = 'resize.php?pic=<?=$oname?>';
image_new.className = 'loaded';
imgdiv.appendChild(image_new);
</script></head>
</html>
<?php
exit();
}
?><html><head>
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ColdFusion Marketplace
- How to validate an image field with javascript (JavaScript / DHTML / AJAX)
- Loading image to HTML (JavaScript / DHTML / AJAX)
- Image Upload/Acquisition (Web Developers' Lounge)
- Need help with Image Swaping in Javascript (JavaScript / DHTML / AJAX)
- calculate image property in javascript (JavaScript / DHTML / AJAX)
- Icon and Thumbnail Display Problem (Windows NT / 2000 / XP / 2003)
Other Threads in the ColdFusion Forum
- Previous Thread: Coldfusion Email Server Software
- Next Thread: Coldfusion Scheduled Tasl


Linear Mode