473,326 Members | 2,124 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,326 software developers and data experts.

How verify type or extension of file using ASPUPLOAD?

Hi,

How verify type or extension of file using ASPUPLOAD?
I check documentation, but I didn't find anything else yet.
thanks,
--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
Jul 19 '05 #1
2 2407
http://www.aspupload.com/manual_simple.html
says
Upload.Files is a collection of UploadedFile objects which offer access to
various properties and attributes of uploaded files, such as filename, path,
size, hash value, etc. The UploadedFile object also offers many methods
which enable you to manipulate uploaded files (copy, move, save to the
database, delete, etc.) Individual items of the collection can be referenced
via numeric or string indices, or iterated through via the For-Each
statement.

which links to
http://www.aspupload.com/object_file.html
that says
FileName As String (Read-Only)
Returns the saved file's name. It may be different from the original file
name if unique file generation (the property Upload.OverwriteFiles) is in
effect.
Usage:

Response.Write File.FileName

So, if that returns a string, you can just check the characters after the
last . for the extension.

"Vilmar Brazão de Oliveira" <su*****@hitecnet.com.br> wrote in message
news:O6*************@tk2msftngp13.phx.gbl...
Hi,

How verify type or extension of file using ASPUPLOAD?
I check documentation, but I didn't find anything else yet.
thanks,
--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC

Jul 19 '05 #2
Hi everybody,
I made something thus:

For Each Arquivo in objUpload.Files
Caminho_e_Arquivo = Arquivo.Path
ExtensaoArquivo = InStr(Arquivo.FileName,".gif")
Exit For
Next

If ExtensaoArquivo = 0 then '»»NÃO foi encontrado a extensão .gif
Response.Write "<script language='JavaScript'>alert('Tipo inválido de
arquivo.\nEnvie arquivo GIF'); "
Response.Write "history.go(-1);</script>"
Response.End()
End If

It was not exactly what I wanted, because I really want to check the kind of
mime file:
image/jpg, image/gif, application/msexcel, etc.... Because the user can
change a file extension, but not the mime type!

Anybody knows anything using aspupload or other component???

Thanks,

--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC

"TomB" <sh*****@hotmailXXX.com> escreveu na mensagem
news:er**************@tk2msftngp13.phx.gbl...
http://www.aspupload.com/manual_simple.html
says
Upload.Files is a collection of UploadedFile objects which offer access to
various properties and attributes of uploaded files, such as filename, path, size, hash value, etc. The UploadedFile object also offers many methods
which enable you to manipulate uploaded files (copy, move, save to the
database, delete, etc.) Individual items of the collection can be referenced via numeric or string indices, or iterated through via the For-Each
statement.

which links to
http://www.aspupload.com/object_file.html
that says
FileName As String (Read-Only)
Returns the saved file's name. It may be different from the original file name if unique file generation (the property Upload.OverwriteFiles) is in
effect.
Usage:

Response.Write File.FileName

So, if that returns a string, you can just check the characters after the
last . for the extension.

"Vilmar Brazão de Oliveira" <su*****@hitecnet.com.br> wrote in message
news:O6*************@tk2msftngp13.phx.gbl...
Hi,

How verify type or extension of file using ASPUPLOAD?
I check documentation, but I didn't find anything else yet.
thanks,
--

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC


Jul 19 '05 #3

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

Similar topics

6
by: Vilmar Brazão de Oliveira | last post by:
HI; How can I rename a file with aspupload or FSO before upload? I looked for in documentation of these products, but I could not find anything yet! Thanks, -- ««««««««»»»»»»»»»»»»»»
23
by: Utada P.W. SIU | last post by:
Hi All, Do you know where have free/buy a upload file component? I need allow user to select the folder instead of select file one by one thanks~~
22
by: Trevor Orton | last post by:
Hello, I'm having a slight problem using the W3C html validator and I've reviewed the FAQ's with no luck so hopefully someone here would be kind enough to point me in the right direction. I...
2
by: Dude | last post by:
Somewhere between 9 - 11 megs I am unable to upload, using either aspupload or the built-in uploading functionality. here is the code from web.config <system.web> <httpRuntime...
2
by: ME via .NET 247 | last post by:
I have a question about how System.Web.HttpPostedFile manages mime types using property ContentType in Windows. When I upload a known "text/plain" file with no extension the property doesnt...
3
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
5
by: mike | last post by:
Hi, I have been playing with VB.NET/C# for getting some general properties of a fileinfo object. However, FileInfo object does not seem to expose some of the basic properties like TYPE that used...
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...
6
by: Laphan | last post by:
Hi All I can't get round this because it's a local government thing, but I've done a CMS for a school (in ASP classic) that allows them to upload gifs, jpgs, pdfs and docs to their site for the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.