How do I or Can I upload images in the CDN using classic asp and sql without file uploader? -
is possible upload images in cdn using simple input text box , insert button? have use classic asp , sql project. need have input box in have type name of image need uploaded cdn after clicking insert button. also, need make file renameable. know how upload images in server not in cdn. know few cdn. kind of appreciat
<input type=text name=inputtxt> <input type=submit name=submit value="insert" class=inputitem>
to store file @ aws s3 need make http requests aws. 1 way using http object asp chilkat.
i found code here (which untested!) illustrates nicely principle behind it:
<head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body> <% ' create http object set http = server.createobject("chilkat_9_5_0.http") success = http.unlockcomponent("anything 30-day trial") if (success <> 1) response.write "<pre>" & server.htmlencode( http.lasterrortext) & "</pre>" end if ' insert access key here: http.awsaccesskey = "abqxxabc83abcdefvqxx" ' insert secret key here: http.awssecretkey = "xxxxyyyyabcdabcd12345678xxxxyyyyzzzz" bucketname = "yourbucket" objectname = "mypicture.jpg" localfilepath = "mypicture.jpg" contenttype = "image/jpg" success = http.s3_uploadfile(localfilepath,contenttype,bucketname,objectname) if (success <> 1) response.write "<pre>" & server.htmlencode( http.lasterrortext) & "</pre>" else response.write "<pre>" & server.htmlencode( "file uploaded.") & "</pre>" end if %> </body> </html>
hope helps on right track - luck!
Comments
Post a Comment