473,788 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Security - uploading images

2 New Member
hi folks,

I've been reading a lot of the discussion going on in this site about security - it has been hugely helpful, so thank you!

I was particularly interested in the discussion at http://www.thescripts. com/forum/thread1954.html . I liked the idea of having uploaded images stored outside of the webroot and only displayed when pulled through by some php code. Has anyone done anything like this? If you could give me some pointers on how it would work I'd be very grateful. I've googled it and not found anything which has helped much.

Thanks very much

Karen
Mar 23 '07 #1
2 1141
ronverdonk
4,258 Recognized Expert Specialist
Welcome to TSDN!

The forum discussion you mentioned in your post really addresses all the issues. Most important one is to have your upload program have write access to a folder outside the document root.

When you do not have that permission (and usually you don't on a shared host) you have to look for the use of htaccess or a login method to prevent outside users from accessing the folder.

Ronald :cool:
Mar 23 '07 #2
kh100uk
2 New Member
Hi,

Thanks for the rapid response!

The bit I wasn't getting was how you actually display an image via a php script if it is stored outside the webroot. Or, how you could use htaccess to allow a file to be viewed only when called from a particular script?

Thanks

karen
Mar 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2713
by: laredotornado | last post by:
Hi, I'm using PHP 4 and I am submitting some images in a form with <form name=addProductForm enctype="multipart/form-data" method=post action="add_product_response.php"> <input type=file name='prodImg' id='prodImg'> However, sometimes, the images fail to upload, even though the form submits fine. When I try to print out the values from the $_FILES array, I get
1
1444
by: psb | last post by:
WHO HAS THE BEST COMPONENT FOR FILE UPLOAD? HELP!? has anyone achieved 100% success with HTTP uploading with Mac clients??? I thought the whole <input type="file" .../> was a w3c standard that goes back 10 years!! I have been doing web development with either asp or asp.net since 1998. I have implemented almost every methodology for file uploading -> com+, asp w/ado.stream, asp.net, asp.net private assemblies. In my past...
3
2316
by: Gavin | last post by:
I need some help, I need the code to allow people that visit my website to be able to upload pictures to a file on my web server. I have been able to get close, but not quite there yet. Set fso = createobject("scripting.filesystemobject") Set act = fso.CreateTextFile(server.mappath("test.jpg"), true) act.WriteLine act.Close The above code will create the file but will not write any data in it. Below
1
2164
by: joe | last post by:
Any articles relating with Uploading images files to server and resize the image by asp.net 2.0
5
2051
by: Deejam | last post by:
hi, i've this situations where user will upload images..my code works fine for uploading images.. but i need to create auto thumbnail picture (of the same image) whenever user upload images... help me how to create thumbnail picture.. is my question clear? thk in advance
1
1152
by: gomzi | last post by:
hi, I have a file upload control in one of my pages. whenever I try to upload an image(only images are allowed), I get a security exceptions error.(Only on my web host's server) This is the exact error that I am getting - > Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'...
1
2077
by: thulaseeram | last post by:
I am using iframe to store uploaded images, it is uploading fine in IE but it is not happening in firefox means first time it is uploading image if i try to upload second image it is not calling even java script function and not uploading the image in firefox. I am using this code in the button onclick event "attach_frame.upload();" here attach_frame is the iframe name and id to which the uploaded image should add. please can any one help me to...
14
4483
w33nie
by: w33nie | last post by:
What I'm trying to do here, is upload a video to the ../video/ folder, and up to 5 images to the ../images/ folder. As well as the database information like title, content and each file's file information. But I really have no idea how to do this. The whole move_uploaded_file part is obviously wrong, but I'm not sure where to go from here to achieve my ends. $videoUploadDir = '../video/'; $imageUploadDir = '../images/'; ...
1
2129
pezholio
by: pezholio | last post by:
Hi, It seems that every time I put together a new script to upload a file I always have problems, here's the latest one: I've got a form with two file input fields, when I submit the form, everything goes OK, but the files don't upload, the permissions on the folders are fine and dandy (Both 777). Here's my code: if(is_uploaded_file($_FILES)){ $target_path = "/home/default/ratemyplace.org.uk/user/htdocs/newsite/images/premimages/";
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.