Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old January 30th, 2007, 04:16 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...and this is the err;

Feiltype:
Microsoft VBScript-kompileringsfeil (0x800A0401)
Forventet slutt på setning expected end
/MyHyperF/bilde_sjekk.asp, line 68, column 59

MyConn4.Execute "UPDATE Produkt SET ProduktBilde = '" <img src = C:/dir/ '" & "' & File.FileName & '" & "' & ">" & '" WHERE ProduktNavn = "' & session("Navn") & '"'
----------------------------------------------------------^

Mvh
grstad
Reply With Quote
  #22 (permalink)  
Old January 30th, 2007, 07:15 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

There is no need to store the '<img src = C:/dir/' in the database. Even if you wanted to how do you know youre host is going to place your web site on its c drive? This is just one of the many things wrong with storing this type of path. Have another read of this entire post for one of the several ways to achieve your 'what do I place in the database for an image reference' I even gave you examples including code on what to store, and how to render your image on the page. If you done it the way I suggested you SQL syntax would be:

"UPDATE Produkt SET ProduktBilde = '" & File.FileName & "' WHERE ProduktNavn = '" & session("Navn") & "';"

FYI There are many things wrong with your sql syntax. Do you have a color coded code editor? If so you should know this already, if not perhaps you should get one.

;;;Sending an email from within the app
XP does not ship the CDONTS.dll it has been depreciated by MS. A couple of options:
1..Download and register the .dll
2..Ask google for the 'CDOSYS syntax' - this is the reccomended mail method and the one I suggest you use

;;;A clients uploading of an image and the apps displaying of that image,
You have been given this link erlier in the post, search this forum for pure ASP upload

;;paging when requesting a recordset
There are so many code examples within this forum and all around the net. Have a go, when you run into problems post the problematic code and error details for help. No one will write this for you, we would all be out of a job if it was tht easy.

Additionaly your 'expected end' error indicated you have not closed out an if or a loop or the like. Is your SQL statement on line 68? I believe your problem is above the statement you have posted.

Wind is your friend
Matt
Reply With Quote
  #23 (permalink)  
Old January 30th, 2007, 10:33 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I agree with matt here and, by and large, most web hosts do NOT store websites on the C:\ drive since this is the default system drive. (If you can exploit the server and the site is on the C drive it potentially allows you access system files and the like)

Regarding CDONTS, why bother downloading it? CDOSYS works just as well and does the same thing, there is no need to be plugging over CDONTS especially when it isnt even installed on the server.

In so far as your Syntax, almost every Database server out there provides some tool to edit Syntax and is color coded as Matt said.
(MySQL has Query Browser, MS SQL has Query Analyzer, etc etc etc)
If your having a problem with your syntax, place it in one of these tools to nail down your problem.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Reply With Quote
  #24 (permalink)  
Old January 31st, 2007, 04:30 PM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...I have now read through this topic and I will limit my posting to the upload-affair.

I have;

      File.SaveToDisk "C:/Inetpub/wwwroot/Ny mappe/brukerfotos/"

and

      MyConn4.Execute "UPDATE Produkt SET ProduktBilde = '" &
      File.FileName & "' WHERE ProduktNavn = '" & session("Navn")
      & "'"

and for displaying the image;

      ...<td width="100"><img src="brukerfotos/<%=trim(Objrs1
      ("ProduktBilde"))%>"></td>...

There are no error-messages, but the image is not displaying, only the common square with a red cross! Let's assume the image-size is within the limitations of IIS. The images are known to be in the dir; I have seen it!

Mvh
grstad
Reply With Quote
  #25 (permalink)  
Old January 31st, 2007, 07:28 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I use absolute paths myself and believe this is a better option. To do this I define several constants in a global file which is called on every page. EG:

some of my global.asp file contents:

const URLBase = "http://localhost/webSiteRootdirName/"
const DocBase = "http://localhost/webSiteRootdirName/uploaded/"
const IUSER = "someUserName"
const PWORD = "somePassword"
const DBNAME = "myDataBaseName"
const DBSERVER = "myPCName"

This is a good practice for many reasons, here are a couple:
1 - IUSER, PWORD, DBNAME and the DBSEVER constants are for my connection string. Once change in one file allows us a global change to my connection string.

2 - URLBase. I use this for all my paths in anchor tags, image tags etc for the same reasons as above. EG:
<a href="<%= URLBase %>admin/somePageName.asp">

Which means you use the DOCBase in the path for your images. EG:
<img src="<%= DocBase %>specials/<%= trim(getInfo(5)) %>"

So if your DOCBase was:
const DocBase = "http://localhost/Ny mappe/brukerfotos/" (why do you have a space? get rid of it)
You would render your image like so:
<img src="<%= DocBase & trim(Objrs1("ProduktBilde")) %>">

Or you could take the easy way out and use a relative path:
<img src="/Ny mappe/brukerfotos/<%= trim(getInfo(3)) %>"

Notice the leading forward slash. Do you make it a hibbit of placing spaces in your dir names for web sites? Why make things harder for your self...

BTW: If you need to ask a new question within an existing post which is not logical according to the title of the post, think about starting a new one - It helps others find answers. You have some useful replies in this post others could benefit from, however they would never expect them based on the post's title.

Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Input type=file apply a filter?? italiansensation ASP.NET 1.x and 2.0 Application Design 3 May 24th, 2006 04:06 AM
INPUT type=file (Urget Help) surendran PHP How-To 1 April 9th, 2006 12:42 PM
input type file darkhalf Javascript 1 October 29th, 2005 02:17 AM
defining location for input type file bleitner Javascript How-To 1 August 24th, 2004 08:15 AM
<input type="File"> - Specify File Type and Path gp_mk Classic ASP Basics 2 August 2nd, 2004 03:07 AM



All times are GMT -4. The time now is 10:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.