473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Detect uploaded files

58
Good morning everyone !

I have a form with an upload section.Currently the form submits user input as normal(direct into database).I want if they upload some file,the file is detected and then they are sent a confirmation email instead.If no file uploaded ,they get a thank you page(as it is now) .This is to at least have some control in the uploads,as am getting some garbage uploads,leaving an upload form sitting vulnerable like that.
I hope if someone can share me the insight of how it can be done.
My gratitude in advance !
May 30 '07 #1
4 1420
pbmods
5,821 Expert 4TB
This is to at least have some control in the uploads,as am getting some garbage uploads,leaving an upload form sitting vulnerable like that.
I hope if someone can share me the insight of how it can be done.
You'll be wanting to analyze your $_FILES array.
May 30 '07 #2
Jankie
58
Can you please elaborate on this a bit more ?
May 30 '07 #3
pbmods
5,821 Expert 4TB
Can you please elaborate on this a bit more ?
Sure. When you upload a file to a PHP script, PHP automatically stores information about the uploaded file in a superglobal array called $_FILES.

For more information, take a look at this page:
http://us2.php.net/features.file-upload

To take a look at your entire $_FILES array at a glance, simply include this code:

Expand|Select|Wrap|Line Numbers
  1. header('Content-type: text/plain');
  2. var_dump($_FILES);
  3. exit;
  4.  
May 30 '07 #4
Jankie
58
Thank you very much !
This will surely get me started
off to implementation
May 30 '07 #5

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

Similar topics

1
by: geradeaus | last post by:
Even if you upload an image partially with ftp software, you can still read the image. Only the image will be partially gray. So, can I determine with a php-function if an image is fully uploaded...
1
by: Murugavel | last post by:
Hi all, Now,we stored uploaded files into our webserver(where the place our site is running) by normal upload function ASP.NET ,but we brought a new server for keeping files. How Can we ...
5
by: IkBenHet | last post by:
Hello, I use this script to upload image files to a folder on a IIS6 server: ******************* START UPLOAD.ASPX FILE ********************** <%@ Page Language="VB" Debug="true" %>
4
by: RedHair | last post by:
I'd like to set up a file system for the ASP.NET 2.0 application to store user-uploaded files, since the members are more than 100,000 people, the basic requirements are as below: (1) The file...
6
by: Kimmo Laine | last post by:
Running IIS 6 on Windows 2003 server. After an update to the most recent version of php 5.1.2, for some reacon a function handling uploaded files using is_file stopped working. is_file failed...
2
by: MagicMyth | last post by:
Hi all, I’m creating a site that allows file uploads to registered users. I’ve got a system in place where if the user uploads a overly large file that it would automatically warn them off the...
14
by: =?Utf-8?B?U2FtdWVs?= | last post by:
Hi, I have a web app that allows others to upload files, and the problem is that if I allow users to upload image files, fake image can be uploaded and cause XSS issues. In the app, I do...
14
by: Jeigh | last post by:
Hello, I'm going to start making a script that will allow users to upload a file, then re download it later. I'll basically be doing the following: - The uploaded file will be given a string of...
7
by: sandeepk84 | last post by:
Hi all... I have file upload option in my web application. I use Struts 2. I wanted to show a preview of the uploaded file to the user. The uploaded file can be of any type like...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.