User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,429 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,637 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 5256 | Replies: 4
Reply
Join Date: Jul 2004
Location: UK
Posts: 4
Reputation: gchq is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gchq's Avatar
gchq gchq is offline Offline
Newbie Poster

Porting asp to asp.NET (with fileup)

  #1  
Jul 2nd, 2004
I am in the process of porting most of our asp apps. to asp.NET and have come across one headache. The process uses two forms to upload images, check they are valid image files, check to see if there are already any registed within the database and delete the old ones, then upload the new ones and record the path within the database.

It gets to ContentType validation with the line :-

==================================================
Line 90: if ( upl.Form(item).ContentType = "image/gif" OR upl.Form(item).ContentType = "image/jpeg" OR upl.Form(item).ContentType = "image/pjpeg") then
=================================================


and then blows out with:-

=============================================

Public member 'ContentType' on type 'String' not found.

Exception Details: System.MissingMemberException: Public member 'ContentType' on type 'String' not found.

============================================

Perhaps I have been staring at this too long, but something is not making any sense. It all worked fine under asp (new attributes like isReference have replaced old ones like isObject -and the usual stuff that stops asp from functioning under .NET)

Any ideas would be appreciated!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Posts: 1
Reputation: rompaa is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rompaa rompaa is offline Offline
Newbie Poster

Re: Porting asp to asp.NET (with fileup)

  #2  
Jul 12th, 2004
I suppose "upl" is of type SoftArtisans.Net.FileUp,

so, have you ever tried casting?

Like replacing
[VB]
if ( upl.Form(item).ContentType = "image/gif" OR upl.Form(item).ContentType = "image/jpeg" OR upl.Form(item).ContentType = "image/pjpeg") then

with something like

[C#]
if ( ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/gif" || ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/jpeg" || ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/pjpeg" )
{ ... }

(I'm sorry, I can read most of VB.net but I can't write it. But I figure you will get my point after all.)
Reply With Quote  
Join Date: Jul 2004
Location: UK
Posts: 4
Reputation: gchq is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gchq's Avatar
gchq gchq is offline Offline
Newbie Poster

Re: Porting asp to asp.NET (with fileup)

  #3  
Jul 12th, 2004
Originally Posted by rompa
(I'm sorry, I can read most of VB.net but I can't write it. But I figure you will get my point after all.)


I have the same problem with C#.

Since posting this I have run into a number of brick walls - the main problem being the way Fileup treats asp and asp.NET in two different ways, so just porting an existing asp app. is not going to work - it was back to basics and then more hassles with Database connections (a ported asp app. will allow OLEDB connections via MS Provider for ODBC connections but pure asp.NET will not) and a host of other. The same old Micro(spit)soft hassle - if you don't use their SQL Server (how did they get away with naming a commercial Database product after a language anyway? - 'nuther soapbox!) then compatability is a joke! We were totally unable to use .NET with a Sybase back end with Framework 1.0 but the later version has improved things - a bit!
Reply With Quote  
Join Date: Jun 2004
Posts: 32
Reputation: jackster is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
jackster jackster is offline Offline
Light Poster

Re: Porting asp to asp.NET (with fileup)

  #4  
Jul 13th, 2004
you could just check the file extension of the file that is being uploaded
www.ansariltd.com
Reply With Quote  
Join Date: Jul 2004
Posts: 2
Reputation: haniebrahim is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
haniebrahim haniebrahim is offline Offline
Newbie Poster

Re: Porting asp to asp.NET (with fileup)

  #5  
Jul 28th, 2004
I tried it too but it failed and i think the reason is the difference syntax between the syntax in VB under ASP classic and the C# under the
Asp.Net
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 1:25 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC