All pastes #197644 Raw Edit

Stuff

public text v1 · immutable
·published 2006-10-11 13:00 UTC
rendered paste body
		set upload = server.createObject("Persits.Upload")
		upload.ProgressID = request.queryString("PID")
		
		response.write "idArtist: """& upload.form("idArtist") &"""<br />"
		
		'idArtist = cLng(upload.form("idArtist"))
		
		for each file in upload.files
			file_i = 1
			file_name = file.fileName
			
			if file.name = "thumb_image" then
				file_path = ROOT &"i\thumb\"
			else
				file_path = ROOT &"i\full\"
			end if
			
			while upload.fileExists(file_path & file_name)
				file_name = replace(file.fileName, "."& file.ext, "") & file_i &"."& file.ext
				file_i = file_i + 1
			wend
			
			file.saveAs file_path & file_name
			
			response.write "saved image as: "& file_path & file_name &"<br />"
			
			if err.number <> 0 then
				status_msg = status_msg &"<p class=""error"">ERROR: Could not upload file "& file_name &".<br />"& err.description &"</p><br /><br />"
				err.clear
			end if
		next
		
		status_msg = status_msg &"<p class=""success"">Successfully Inserted Photograph</p><br /><br />"
		
		proc = run_upload_proc(upload, adoProc, "sp_getArtists", 0, rsArtist)
		
		if proc <> true then
			status_msg = status_msg &"<p class=""error"">ERROR: Could not retrieve artists.<br />"& proc &"</p><br /><br />"
		end if
		
		set adoProc = nothing