0

in my application Tiff, PDF and other image files are uploaded. I want to validate if selected tiff file size is less then 10mb and number of pages in it is less then 20 then upload it. Or simply show a prompt.

Is this possible in any way? Please feel free to suggest third party plugins or silver light or any thing.

Thanx

Fazal Wahid
  • 175
  • 2
  • 17
  • Its not possible to get additional info of any file unless and until you upload it to server and then check it. Its like how can i know if mango is sweet or not without eating it. – Milind Anantwar Jun 02 '14 at 14:53

1 Answers1

0

Using Itextsharp is the good idea for parse and create operations for PDF files. For Tiff size use something like this

Community
  • 1
  • 1
V319
  • 150
  • 1
  • 13
  • i want it before uploading. it take lots of to upload and then return size and number of pages for tiff. – Fazal Wahid Jun 02 '14 at 15:11
  • And filesize depends on your js-way to organize the download process. May be this will help you http://stackoverflow.com/a/2966102/2957717 – V319 Jun 02 '14 at 15:15
  • yes its perfect for PDF, but i need same type of thing for tiff. – Fazal Wahid Jun 02 '14 at 15:19
  • I'm afraid, that every file should have its own approach of page-count, unless you can convert it to the one universal file(for example doc-> pdf, ect) and just then get required information. I am not sure, that this is good solution (especially for big files), so you'd better make some predefined size checks and perform deep validation on server. – V319 Jun 02 '14 at 15:36