954,180 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Uploading images on a server

hi
can anyone give me an asp code for uploading images on a server.
Have been trying the code on free asp upload but am getting a message that the directory in whicj i want to upload does not exist where as it do exists.
When i remove read only properties from the directory then it too mauch time and the page does not even appear.

prats_20
Newbie Poster
3 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

0 then 'Destination is specified. check its validity. ''''' fDestination = clng(fDestination) ''''' if fDestination>=0 and fDestination0 then if len(DestinationPath) > 0 then Form.Files.Save DestinationPath response.redirect("Videouploaded1.asp") response.write "
Files (" & Form.TotalBytes \1024 & "kB) was saved to " & DestinationPath & " folder." else response.write "
Bad destination path." end ifElseIf Form.State > 10 then Const fsSizeLimit = &HD Select case Form.State case fsSizeLimit: response.write "
Source form size (" & Form.TotalBytes & "B) exceeds form limit (" & Form.SizeLimit & "B)
" case else response.write "
Some form error.
" end SelectEnd If'Form.State = 0 then%> Select VideoName(Select) File 1 :


Video Description :


//Expand form with a new File fields if needed.var nfiles = 3;function Expand(){ nfiles++ var adh = '
File '+nfiles+' : '; files.insertAdjacentHTML('BeforeEnd',adh); return false;}This is one of my page that i used for Image uploading to server..if u want more details u contact me on the Mail : [email]radha_992@yahoo.co.in[/email]

radharadha
Newbie Poster
6 posts since May 2006
Reputation Points: 10
Solved Threads: 1
 

This is one of my page that i used for Image uploading to server..if u want more details u contact me on the Mail : [EMAIL="radha_992@yahoo.co.in"]radha_992@yahoo.co.in[/EMAIL]

<%
'Stores files to the clients specified destination folder
'Client can choose folder from a dropdown
'Remember that ther is NO good idea to let clients store files in ANY folder!
Dim DestinationsToChoose, cDest
'DestinationsToChoose = Array("c:\upload", "d:\inetpub\data1", "f:\store")
DestinationsToChoose = Server.MapPath("Images/")
'Create upload form
'Using Huge-ASP file upload
'Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
'Using Pure-ASP file upload
Dim Form: Set Form = New ASPForm %><%
'Server.ScriptTimeout = 2000

Server.ScriptTimeout = 3000
Form.SizeLimit = &HA00000
If Form.State = 0 Then 'Completted
Dim DestinationPath, fDestination
dim videoname,VName,v
videoname=Form("video")
VName=Form("T1")
v="Images/" & VName
'response.write(vname)
dim D1
D1=Form("txtFrom")
dim rsCheck
set rsCheck=mycon.execute("select * from CategoryDetails where Id="& videoname &"")
if not rsCheck.eof then
dim video
video="Images/" & rsCheck(2) & ".MP4.2"
mycon.execute("update CategoryDetails Set Video1='"& v &"',D1='"& D1 &"' where Id="& videoname &"")
else
response.redirect("notAssigned1.asp")
end if
rsCheck.close

'read destination index
'''''fDestination = Form("fDestination")
'''''if len(fDestination)>0 then
'Destination is specified. check its validity.
''''' fDestination = clng(fDestination)
''''' if fDestination>=0 and fDestination<=ubound(DestinationsToChoose) then

'''''DestinationPath = DestinationsToChoose(fDestination)
DestinationPath = DestinationsToChoose

''''' end if
''''' end if'if len(fDestination)>0 then
if len(DestinationPath) > 0 then
Form.Files.Save DestinationPath
response.redirect("Videouploaded1.asp")
response.write "
Files (" & Form.TotalBytes \1024 & "kB) was saved to " & DestinationPath & " folder."
else
response.write "
Bad destination path."
end if
ElseIf Form.State > 10 then
Const fsSizeLimit = &HD
Select case Form.State
case fsSizeLimit: response.write "
Source form size (" & Form.TotalBytes & "B) exceeds form limit (" & Form.SizeLimit & "B)
"
case else response.write "
Some form error.
"
end Select
End If'Form.State = 0 then
%>
HTML>
ASP huge file upload - upload to a specified destination.
 
      


Upload timeout is <%=Server.ScriptTimeout%>s

Form size limit is <%=Form.SizeLimit \ 1024 %>kB








<%
'Dim lDestinationsToChoose
'For lDestinationsToChoose=0 to ubound(DestinationsToChoose)
' response.write "" & DestinationsToChoose(lDestinationsToChoose)
'next
%>


Select VideoName
(Select)
<%
dim rsFeed
set rsFeed=mycon.execute("select * from CategoryDetails")
while not rsfeed.eof
response.write(""& rsFeed(2) &"")
rsFeed.movenext
wend
%>


File 1 :



Video Description :



radharadha
Newbie Poster
6 posts since May 2006
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You