Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

uploading images

New Here ,
Feb 26, 2007 Feb 26, 2007
i have done a tutorial for uploading images the images were going into the folder but when i added the command for uploading the data to the database nbothing is working now just wont display anything
browse file name = Filename
description = Description
form = form1

the name of the desription field is Description
file field = Filename
form = form1

'Add the details of the uploaded file to the database
Dim myFile, myDescription
myFile=Filename
myDescription=Uploader.Form("Description")

set cAddDetail = Server.CreateObject("ADOBE.Command")
cAddDetail.ActiveConnection = MM_robdalt_starsearch_STRING
cAddDetail.CommandText = "INSERT INTO tblUploadedFiles (Filename,
Description ) VALUES ( '" & myFile & "', '" &
myDescription & "' ) "
cAddDetail.CommandType = 1
cAddDetail.CommandTimeout = 0
cAddDetail.Prepared = true
cAddDetail.Execute()

anyone help
TOPICS
Server side applications
777
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 26, 2007 Feb 26, 2007
Rob,

First of all, are you new working with data-driven website? I see that you are probably new to work with data-driven website.

The question is obvious and not to overlook. Because it is the core of any database design project. What kind of database server does your web hosting support? For example, PHP, ASP, JSP, so on.

In order to work with data-driven website project, you need to have some things installed on your local machine. Do you have ASP or JSP or PHP installed on your local? How about Apache web server installed?

I realize that you didn't mention what system architecture and what version of Dreamweaver you are working with?

Lastly, and it is important not to overlook this important topic -- security of your local machine and web servers. You need to make sure that your data-driven code is done correctly and need to make sure to prevent some kind of virus, macious, horrible infection of software which can be uploaded to your web server without your knowledge or realization. There are ways to prevent that from happening. That is to say, it is a bit more challenging, and involves a deep understanding on how data-driven websites work, and what is invovled and what not.


quote:

Originally posted by: rob dalton
i have done a tutorial for uploading images the images were going into the folder but when i added the command for uploading the data to the database nbothing is working now just wont display anything
browse file name = Filename
description = Description
form = form1

the name of the desription field is Description
file field = Filename
form = form1

'Add the details of the uploaded file to the database
Dim myFile, myDescription
myFile=Filename
myDescription=Uploader.Form("Description")

set cAddDetail = Server.CreateObject("ADOBE.Command")
cAddDetail.ActiveConnection = MM_robdalt_starsearch_STRING
cAddDetail.CommandText = "INSERT INTO tblUploadedFiles (Filename,
Description ) VALUES ( '" & myFile & "', '" &
myDescription & "' ) "
cAddDetail.CommandType = 1
cAddDetail.CommandTimeout = 0
cAddDetail.Prepared = true
cAddDetail.Execute()

anyone help


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2007 Feb 26, 2007
yeah i have a website i use asp and access and work with dreamweavermx i my server supports the upload my images were going into the folder but the command was not working
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 26, 2007 Feb 26, 2007
Can you post a link, so we can take a look at it and see what went wrong.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2007 Feb 26, 2007
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2007 Feb 26, 2007
the upload was working until i added the command i posted the command above and the details of my database fields
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 26, 2007 Feb 26, 2007
Active Server Pages error 'ASP 0116'

Missing close of script delimiter

/uploadThisFile.asp, line 4

The Script block lacks the close of script tag (%>).
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2007 Feb 26, 2007
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/robdalt_starsearch.asp" -->
<!--#include file="Upload.asp" -->
<%
'Upload the image file and get reference to component
Dim Uploader, File
Set Uploader = GetASPUploader

'Use AddFile method to add file objects and change their properties as needed
Set File = Uploader.AddFile("file")
'The the properties of the upload
File.ValidFileTypes = "doc,pdf,txt,xls,mdb,jpg,gif,bpm,png"
File.MaxSize = 1024*1024
File.Overwrite = false 'Do not overwrite, create unique filename
'Set the folder name to where the file will be uploaded to
Uploader.Destination = "D:\hshome\robdalto\starsearchentertainment.com\images\uploadedfiles\"
'Set longer timeout for large files if needed
Server.ScriptTimeout = 900
'Enable error handling to catch and handle errors during upload. For example, if user cancels the upload or attempts to upload files of invalid (unallowed) type or size, ASPUploader will raise an exception (error) with relevant description
On Error Resume Next

'Start receiving and saving file(s):
Uploader.Upload

'Check for errors:
If Err Then
'Redirect with error message
Response.Write err.description
Response.End()
'Add the details of the uploaded file to the database
Dim myFile, myDescription
myFile=Filename
myDescription=Uploader.Form("Description")

set cAddDetail = Server.CreateObject("ADOBE.Command")
cAddDetail.ActiveConnection = MM_robdalt_starsearch_STRING
cAddDetail.CommandText = "INSERT INTO tblUploadedFiles (Filename,
Description ) VALUES ( '" & myFile & "', '" &
myDescription & "' ) "
cAddDetail.CommandType = 1
cAddDetail.CommandTimeout = 0
cAddDetail.Prepared = true
cAddDetail.Execute()
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>

</body>
</html>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2007 Feb 26, 2007
i see the opening tag at the top where do i put the closing tag
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2007 Feb 26, 2007
i have added a bit of code to close the <% but i still wont work its not coming up in my browser where the error is

Uploader.Destination = "D:\hshome\robdalto\starsearchentertainment.com\images\uploadedfiles\"
'Set longer timeout for large files if needed
Server.ScriptTimeout = 900
'Enable error handling to catch and handle errors during upload. For example, if user cancels the upload or attempts to upload files of invalid (unallowed) type or size, ASPUploader will raise an exception (error) with relevant description
On Error Resume Next


'Finally, void the object
Set Uploader=Nothing
%>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 26, 2007 Feb 26, 2007
I don't know much about ASP pretty much. Hopefully that there is other participants could help you with that. Let's cross your fingers and hoping that someone else chime in and offer you a better tip than I am. Sorry!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 27, 2007 Feb 27, 2007
this is my ammended code but it still wont work if anyone can help me please do

Link
http://www.starsearchentertainment.com/fileUpload.asp


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/robdalt_starsearch.asp" -->
<!--#include file="Upload.asp" -->
<%
'Upload the image file and get reference to component
Dim Uploader, File
Set Uploader = GetASPUploader

'Use AddFile method to add file objects and change their properties as needed
Set File = Uploader.AddFile("file")
'The the properties of the upload
File.ValidFileTypes = "doc,pdf,txt,xls,mdb,jpg,gif,bpm,png"
File.MaxSize = 1024*1024
File.Overwrite = false 'Do not overwrite, create unique filename
'Set the folder name to where the file will be uploaded to
Uploader.Destination = "D:\hshome\robdalto\starsearchentertainment.com\images\uploadedfiles\"
'Set longer timeout for large files if needed
Server.ScriptTimeout = 900
'Enable error handling to catch and handle errors during upload. For example, if user cancels the upload or attempts to upload files of invalid (unallowed) type or size, ASPUploader will raise an exception (error) with relevant description

'Start receiving and saving file(s):
Uploader.Upload

'Check for errors:
If Err Then
'Redirect with error message
Response.Write err.description
Response.End()
End If

'Finally, void the object
Set Uploader=Nothing

'Add the details of the uploaded file to the database
Dim myFile, myDescription
myFile=Filename
myDescription=Uploader.Form("Description")

set cAddDetail = Server.CreateObject("ADODB.Command")
cAddDetail.ActiveConnection = MM_robdalt_starsearch_STRING
cAddDetail.CommandText = "INSERT INTO tblUploadedFiles (Filename,
Description ) VALUES ( '" & myFile & "', '" &
myDescription & "' ) "
cAddDetail.CommandType = 1
cAddDetail.CommandTimeout = 0
cAddDetail.Prepared = true
cAddDetail.Execute()

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>

</body>
</html>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 28, 2007 Feb 28, 2007
Just in case you get to the end of your rope on this and need something
that is EASY. Try http://www.dmxzone.com and look at the Pure ASP and
Smart Image Processor extensions.

200-300 dollars but well worth it considering how much time I save using
them.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 01, 2007 Mar 01, 2007
got it bud cheers. The upload if fine sending the image to the folder and sending the data to database. But my image path in the database shows myimage.jpg

my folder where the image is is images/uploadedFiles/myimage.jpg i dont want to move my images how to i get the files path in my database to read

images/uploadedFiles/myimage.jpg
NOT myimages.jpg
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 01, 2007 Mar 01, 2007
LATEST
This is how you want it. What you do is hardcode the path into your image tag. Like so:

<img src="../../images/uploadedFiles/<%=rs.fields.item("image").value%>">
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines