Link to home
Start Free TrialLog in
Avatar of leronj23
leronj23

asked on

Preview Uploaded Picture in Flash 8 Before going to Server

I need Help Fast. i have my website to the point where people can come and upload images to my server, but i want them to see a preview of the image and if they dont want that image. it will not save to my server. if they except the image. then it will goto my server. Please help me ASAP. My website is almost complete.

500 points with a Grade A
Avatar of Ramy_atef
Ramy_atef

Hi
Here is a source file with something like you want but it is uploading the image then breview it . i suggest that if the user didn't like the preview you can delete it from the server ..

http://www.flash-db.com/Tutorials/upload/

Regards,
Ramy
Avatar of leronj23

ASKER

I seen that tutorial. theres no way to avoid downloading the image to me server?  Im trying to avoid that. If i have 10,000 users come to my site and 2000 image are bad images because they downloaded the wrong one. then i have to delete 2000 images.
well, you can delete the image if the user click on "delete image" button (using php) , I don't think it would be a problem with PHP. of course you won't delete those images yourself manually, let the php do it for you

Regards,
Ramy
well i have the image path store in sql and the actual image i have stored into my yahoo server. Can php actually delete the image from my yahoo sever? I know i can delete the path in sql using php.
you mean yahoo server as you are hosting the site at yahoo (paid server "Yahoo! Small Business") or free service like geocities ??
i pay for yahoo! small business and there're hosting my site. Is there a way to store the image in sql to make life easier?
in that case, you can delete the file using php easily using php

unlink('D001_image.jpg');

or
$dir = "/path/to/images";
$file = "myImage.jpg";
 unlink($dir . "/" . $file);

Here is a link of a complete explanation about unlink function

http://www.php.net/manual/en/function.unlink.php

Regards,
Ramy
can i use:

unlink($dir);

To delete the entire folder from my server also?
Hi

To delete all files of a particular extension, or infact, delete all with wildcard, a much simplar way is to use the glob function.  Say I wanted to delete all jpgs .........

<?php

foreach (glob("*.jpg") as $filename) {
   echo "$filename size " . filesize($filename) . "\n";
   unlink($filename);
}

?>

also

To delete files using wildcards:

<?
function delfile($str)
{
   foreach(glob($str) as $fn) {
       unlink($fn);
   }
}
?>

Regards,
Ramy
i read that already, but do i make $str = "the name of the Folder"

<?
function delfile($str)
{
   foreach(glob($str) as $fn) {
       unlink($fn);
   }
}
?>

will this delete the "Folder" from the server?
that case u can use rmdir()

http://www.php.net/rm_dir

Regards,
Ramy
im sorry to be a pest. I read the link. but what would be the easiest way to write the script for me to delete the folder "Pictures" with everything in it.
ASKER CERTIFIED SOLUTION
Avatar of Ramy_atef
Ramy_atef

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You answer 2 question for me. If i could i would give you a 1,000,000 points thanks.

you helped me with the following:

if someone uploads a picture to my site. when they preview it. if they dont like it i use php to delete it from my "Tempupload" folder.

After 30 days when their time is up. i can write a php file to delete their whole folder from my site.

Thank you. This is the second time you helped me. Money will spent.
Glade i could help :)

Ramy