Changing File ext. to File

Posted by haleyhosting_com, 03-24-2007, 01:31 PM
i have a site upithere.com . its a pretty popular photo hosting site. what i want to do is .. when a pic is uploaded to put some kind of watermark on it. like "Hosted at UpItHere.com". i have no clue how to do this automaticly in php so i could do it the manual way. now on the server when the files are uploaded.... say someone uploaded 1.jpg .. in the uploads folder it would just have a file there named one. so i downloaded this file. and gave it an extension of jpg and that did the trick i could view the image. now i can manualy add a little watermark to it. but now inorder to it to work i have to somhow save the file without an ext. so when you right click on it and go to properties to view the ext. it just says File ....................................anyone have a clue?

Posted by zwolf, 03-24-2007, 02:35 PM
Im not sure that I really understand what you are asking, but if you are trying to simply remove a files extension manually, you can simply remove the extension using Windows Explorer (If using Windows). Click rename and then simply remove the extension. I tried checking your site to see what you were refering to, but the page froze on your hosted image page. The method your using of manually downloading and adding a watermark sounds like it is going to be very time consuming for you if your site gets very busy. Check this link: http://tips-scripts.com/?tip=watermark#tip - A script to automatically add a watermark to images, I have never used it, but hopefully it will work for you. Sorry, had to mention this: Your slogan currently reads: "Free, Fast and Free" - just a suggestion, how about: Fast, Free & Easy! -? Might make a little more sense. Lots of luck. Last edited by zwolf; 03-24-2007 at 02:43 PM.

Posted by bleenzorb, 03-25-2007, 07:22 AM
Are you messing with the filename extension simply to prevent a client from accessing the jpg until it has had a watermark applied? If that's the case, here's a better solution, I think: simply name a directory something cryptic, like "uploads0982345". Go ahead and set the permissions on that dir to 755 so the server can still get to it, but users won't know its URL (because of the cryptic directory name). Upload new images there. When you add the watermark, move the file to another directory that users do know about. Watermarking with PHP is pretty easy and there are lots of options. Just do a search.

هل استفدت من هذا الجواب؟

 أطبع هذا المقال

اقرأ أيضا

kernel exploit!

Posted by tkanaco, 06-27-2008, 11:27 PMHow Can i translate An Kernel Exploit to secure my server...

Brand new spam attacks - Seems like an emergency

Posted by ub3r, 03-18-2007, 04:12 PMThis afternoon I noticed a pattern of spam on several...

Voxtreme Resellers

Posted by BARNE, 09-05-2002, 02:16 PMI am looking at Voxtreme for setting up a resellers account...

Redirect domain/user to user.domain ONLY IF folder 'user' doesn't exist

Posted by ThatScriptGuy, 05-07-2007, 04:22 PMWell, I thought I knew enough about my .htaccess...

Load Balancing 2 Web servers and 2 MySQL Servers

Posted by YYamagishi, 03-28-2008, 04:02 AMHi, I was wondering if it is possible to cluster 2 web...