473,394 Members | 1,843 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,394 software developers and data experts.

Checking file type of a file in perl

129 100+
Hai friends,
I have a doubt that if we are having a page which having the functionality to upload a file, then if we want to restrict to some types of files only have to be uploaded ex:- jpg,png.... .Then i am using Apache2::Upload module in which we can get the type of file using type function.

But the users are very smart than me. They changed the extension of pdf file into jpg and they are uploading the files. This is succeeding because Apache2::Upload module will checks the file type by extension.

When i searched i got File::Type module and it working in perl file means .pl, if i wants to work same in .pm(Modperl) file then it is not working.

Can any one say why it is not working (or) is there any other module or other way to find the file type by its data, not by extension. Please help me friends.
Jan 8 '10 #1
1 2846
numberwhun
3,509 Expert Mod 2GB
Ok, we are going to need a bit more information before we can help you discover what is wrong. There is a world of difference between a .pl file (which is a Perl file containing standard windows code for execution) and a .pm file (which is a Perl module file, which is a bit different from a regular script file).

Can you be more specific as to what you have put in both? How about putting your code here, in code tags, for each file. That will help us get a visual. Also, please describe what you are or are not seeing with both files executions.

Regards,

Jeff
Jan 8 '10 #2

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

Similar topics

2
by: Marc S. Gibian | last post by:
I am putting together a Perl tool to manage a large set of tasks related to building a rather complex set of software. One of the goals for moving to Perl is to provide very rigorous error checking...
2
by: brad | last post by:
I am new to perl and would like to know how to check the return values of a perl program in a batch file. how can I save the return value of the perl program and use it to make decisions as to...
0
by: Eric Li | last post by:
Hi, I used to have a web page with "<input type="file" name="FileName" size=20> field to upload file to one of my Perl program in the server side. Now I would like to use C# program to upload...
1
by: DavidA | last post by:
I have a very simple form and perl script that is to upload a jpg file. I am not familiar with the perl language but copied the code from a text book. It works fine with all browsers except IE....
1
by: eadavid | last post by:
HI, I am a beginner to perl and I need to write perl code for checking a good die in the wafermap. Here is the wafermap look like in file ....XXXX111111111X1111XXXX.......
1
by: halcyon943 | last post by:
have 4 folders that I watch and need to move files from to another location. Three constraints: -Finish time. Make sure the program stops transferring files at a specific time -Number of...
11
by: sweetbox | last post by:
Hi Guys! I am new on this forum and I am hoping that I could acquire help to improve my PERL skill. My goal is to be able to create a report of all broken links from a website. Based from my...
4
by: rsaharia | last post by:
Hello All, I need help with this particular .pl file I picked up from http://www.veritools-usa.com/xnf2vhdl.htm What it's supposed to do is really convert an xnf file to a vhdl file. I need it for...
4
by: nitupatra | last post by:
I have perl script which will make a zip file and create a HTML form with asubmit button to send the zip file client. When user click the download button the zip file will be downloaded. But the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.