473,882 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to prevent the user uploading corrupted or damaged files?

Hi,
User will upload only picture and pdf files. I have return a asp.net
application for that,But thing is I need to restrict the user
uploading corrupted or damaged files.
Can anyone have any idea?

Apr 24 '07 #1
4 2035
Hello muthu,

You need to intro either the ActiveX control which will validated the file
format (google for "image validator") or do it on server side.
But I don't think that it's very easy task.
---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

mHi,
mUser will upload only picture and pdf files. I have return a asp.net
mapplication for that,But thing is I need to restrict the user
muploading corrupted or damaged files.
mCan anyone have any idea?
Apr 24 '07 #2
AFAIK, no built-in way. One crude option is to take the image stream on the
server-side and try loading into an Image class (as in
System.Drawing. Image.FromStrea m(Request.Files[0].InputStream)) and see if it
throws ArgumentExcepti on. If it does, the uploaded file is not an image.

Not sure how to do for PDF files.

"muthu" wrote:
Hi,
User will upload only picture and pdf files. I have return a asp.net
application for that,But thing is I need to restrict the user
uploading corrupted or damaged files.
Can anyone have any idea?

Apr 24 '07 #3
Thanks for your valuable reply,
I am looking for some otherway.
On Apr 24, 2:36 pm, Siva M <shiva...@onlin e.excite.comwro te:
AFAIK, no built-in way. One crude option is to take the image stream on the
server-side and try loading into an Image class (as in
System.Drawing. Image.FromStrea m(Request.Files[0].InputStream)) and see if it
throws ArgumentExcepti on. If it does, the uploaded file is not an image.

Not sure how to do for PDF files.

"muthu" wrote:
Hi,
User will upload only picture and pdf files. I have return a asp.net
application for that,But thing is I need to restrict the user
uploading corrupted or damaged files.
Can anyone have any idea?- Hide quoted text -

- Show quoted text -

Apr 24 '07 #4
most anti-virus vendors sell a toolkit with an api you can use to do this.

-- bruce (sqlwork.com)

muthu wrote:
Hi,
User will upload only picture and pdf files. I have return a asp.net
application for that,But thing is I need to restrict the user
uploading corrupted or damaged files.
Can anyone have any idea?
Apr 24 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1104
by: Edward Low | last post by:
Hi, How should i allow user to upload multiple files in a page and display message on the page to inform the client the file is being uploading while the upload process still in progress? for example user upload 3 files.... then system should response to user while uploading until finish uploaded: please wait: file 1 is being uploaded..... file 1 is successfully uploaded. please wait: file 2 is being uploaded.... file 2 is successfully...
3
2075
by: Dean Richardson | last post by:
Hi, I'm having trouble uploading files via a PHP script. Whenever I upload a file greater than 10K, the file gets corrupted. However, text files upload OK. When I check the FTP Server log I find this:
0
1044
by: Michael | last post by:
Hi, Most of my site works fine. The problem is that when I try to log out I get an error: Server Error in '/MyApp' Application. -------------------------------------------------------------------------------- The state information is invalid for this page and might be corrupted.
1
1616
by: Chris | last post by:
We have offer a web space to hosting our client website. We offer them to upload asp files to their web space. How can I prevent the client from uploading asp files that will harm our web server. For example, deleting files in our server using Scripting.FileSystemObject to delete our system files. Please advise me how to prevent from happening. Regards Chris
1
2088
by: =?Utf-8?B?UnVzc2VsbA==?= | last post by:
Some sage tech told me, in an online discussion on how to keep my computer clean and working smoothly, that it was ok to delete all of the "downloaded program files" that reside in that internet options, browsing history, settings, view objects, place....(i have IE7, so to get to them is a little different than IE6, etc.). Anyway, I took his "wise and sage" advice and deleted all of my DOWNLOADED PROGRAM FILES, while I was doing my other...
15
4333
by: Larry Bud | last post by:
I rarely crosspost, but this affects both ASP and Javascript REALLY odd bug that I ran across in ASP 3.0. I have an input type of file, user clicks browse, then places his cursor in the filename, puts a space at the end of the file, and uploads it. Web server doesn't translate the MIME type of document properly because it doesn't end with a valid extension, yet the file itself uploads successfully. I'm using SAFileUP for my uploading...
2
1314
by: Mayer, Stefan | last post by:
Hi, for some other reasons, where i have no influence and no possibility to change it; it is necessary to upload files tempoarily to a temp-folder in my web-project. Allthough the files are deleted a frew seconds after uploading, ASP.net compiles the whole web at the first time a aspx-File ist requestet via Browser - and this takes about 10-30 Seconds. Is there a possibility, how i can tell ASPNET not to compile the web if something...
3
1731
by: Robert Dunlop | last post by:
I am using Microsoft Visual Studio 2005 for development of an ASP.NET site, and I have a problem that greatly effects my workflow at times. It seems that after I upload new files anywhere within the directory structure of the site that is visible to VS, the next time I perform a build VS takes extra time, apparently downloading the new files (though the time required seems much longer than a one-time download should take). During this...
6
1474
by: beary | last post by:
Hi, hope this is in the right topic... Running php5 on apache. I've setup a site where people can login as "demo", "demo" and play around with the functions of the site. Part of the functionality involves uploading files, deleting/editing using standard form fields and storing data in Mysql. I want people *not* to be able to delete things, or upload files bigger than 100KB when they're logged in as "demo". I'm wondering if there's a...
0
9931
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9776
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,...
1
10827
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
10403
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
9556
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...
1
7954
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5978
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3226
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.