Solved

PHP handle file upload

Posted on 2011-09-29
4
346 Views
Last Modified: 2012-05-12
I am writing the PHP handle upload the file, how can I control the user only upload odt file, I know that using $_FILES["file"["type"] match "application/msword" to control the doc file, but seems no odt file extension control, any alternative way?

0
Comment
Question by:liyy
  • 3
4 Comments
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 36860155
Otherwise, you can validate through javascript before you start upload process.
0
 

Author Comment

by:liyy
ID: 36889987
thanks logudotcom,

is there any existing JavaScript code I can search?
0
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 125 total points
ID: 36890204
Just ref these,

sample 1

sample 2
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 36890205
you can also google, "check file extension in javascript before upload"
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question