Shadow Uploader - preventing user from uploading non image files


(regarding this thread: http://forums.aspfree.com/code-bank-...res-94647.html)

Originally Posted by Shadow Wizard this will not save non-image files. as for extension, I fear I didn't understand what you
mean - you try to save the file with different extension\t I disagree. I was able to upload an Excel Spreadsheet with no trouble at all.
Posted On: Friday 26th of October 2012 02:47:37 AM Total Views:  593
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




VBScipt: Call builtin functions shadowed by global variables

VBScript on ASP Classic contains an "int" function. (It rounds numbers towards -8.) Suppose that some excessively "clever" coder has created a global variable named "int". Is there any way to get at the original function I've tried all manner of workarounds with scoping and dodgy execs, but no dice. I suspect that it is impossible, but I'm hoping that someone will know more about it than I do. EDIT:
VIEWS ON THIS POST

346

Posted on:

Friday 17th August 2012
View Replies!

Shadow uploader problem

shadow, I am using your code to upload files doc, pdf. It gives me an error like this Microsoft VBScript runtime error '800a004c' Path not found /secure/ShadowUploader.asp, line 283 here is my code Code: Set objUpload=New ShadowUpload If objUpload.GetError"" Then Response.Write("sorry, could not upload: "&objUpload.GetError) Else For x=0 To objUpload.FileCount-1 txtpdffile=objUpload.File(x).FileName Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploaddocuments"), "") Next End If
VIEWS ON THIS POST

213

Posted on:

Thursday 30th August 2012
View Replies!

uploader with multi element form

i need to find some scrit to uploadimages but with multi elements form i mean i need to put some textboxes and compo boxes with the uploading form to process the data entered in the text boxes and copbo boxes something = the posting new thread u can write ur thread and choose file to attach hope it's clear , it's working like a dream but how can i make some limit for file size i mean if the user tried 2 upload a file more than somw size he gets error messege \t also how can i change the files directory to a ub directory from the pages directory like images or download what ever thx alot jofa and jmi
VIEWS ON THIS POST

288

Posted on:

Tuesday 18th September 2012
View Replies!

ASP bulk file uploader script, zip or other method?

ASP bulk file uploader script, zip or other method Any one know of such a script Also something that doesn't require any server side installing
VIEWS ON THIS POST

219

Posted on:

Monday 24th September 2012
View Replies!

file uploader

Hi ! I've been having some trouble with a file uploader script, the script times out when running, I have tried extending the default timeout length. I have also tried a couple of other file upload scripts and thay all time out too. I can't seem to find a cause to the problem. I have a second server and it runs beautifully! If anyone has any ideas or solutions, I'd b grateful! thnx!!
VIEWS ON THIS POST

197

Posted on:

Monday 24th September 2012
View Replies!

Shadow uploader, expect word docs or pdfs only?

hi could someone point me in teh right direction for the shadow uploader to only acccept .doc or .pdf if not dont upload cheers
VIEWS ON THIS POST

226

Posted on:

Monday 24th September 2012
View Replies!

Page 2 - Shadow uploader, expect word docs or pdfs only?

well it works again but the filename is not changed :S EDIT heres my code Code: strFilePath = GetFirstAvailablePath(Server.MapPath( "/vivergo/cvs/" & objUpload.File(x).FileName )) Call objUpload.File(x).SaveToDisk("", strFilePath)
VIEWS ON THIS POST

238

Posted on:

Monday 24th September 2012
View Replies!

Shadow uploader

I have used the Shadow Uploader from the code bank for uploading images will it work for if i am going to upload 10 pdf files Any idea todd
VIEWS ON THIS POST

308

Posted on:

Wednesday 10th October 2012
View Replies!

Shadow uploader?

how can i make it so it only allows .jpeg,.jpgs, and .bmps to be uploaded thanx
VIEWS ON THIS POST

230

Posted on:

Wednesday 10th October 2012
View Replies!

How to attach recent uploaded file to mail with help of aspsmartuploader and cdonts?

Hi , I have created an asp form which I want to use to retrieve attachment from my site users. I am using Aspupload Component on sever to upload attach file on server at specific location. Although I am able to upload attach file on server. Also I created to retrieve attachment from mail its not working. Can any one help me out to make form or code to retrieve uploaded file as attachment through mail. Here is file where user fill his information and attach his CV. Job Apply Pleae fill below form to apply job you wish Company Name  :    Position  :    Attach Resume  :    *    :    Contact Email  :    Cover Letter  :      Please help me out to make process form code to retrieve uploaded file and submitted information through mail. JIMI
VIEWS ON THIS POST

397

Posted on:

Wednesday 10th October 2012
View Replies!

cpshost.dll for image uploader

Im building an image uploader to be used so that a client can upload images from their desktop to the site. Is it correct that I have to download the cpshost.dll from microsoft and then upload that file in a folder named for instance Scripts, so that the form is able to upload images before moving onto the processing asp page (manageproducts.asp). My URL is as follows: http://domain714858.sites.fasthosts....geproducts.asp Am I right what I think cheers lee
VIEWS ON THIS POST

278

Posted on:

Thursday 11th October 2012
View Replies!

uploader with multi element form

i need to find some scrit to uploadimages but with multi elements form i mean i need to put some textboxes and compo boxes with the uploading form to process the data entered in the text boxes and copbo boxes something = the posting new thread u can write ur thread and choose file to attach hope it's clear , it's working like a dream but how can i make some limit for file size i mean if the user tried 2 upload a file more than somw size he gets error messege \t also how can i change the files directory to a ub directory from the pages directory like images or download what ever thx alot jofa and jmi
VIEWS ON THIS POST

225

Posted on:

Thursday 11th October 2012
View Replies!

file uploader

Hi ! I've been having some trouble with a file uploader script, the script times out when running, I have tried extending the default timeout length. I have also tried a couple of other file upload scripts and thay all time out too. I can't seem to find a cause to the problem. I have a second server and it runs beautifully! If anyone has any ideas or solutions, I'd b grateful! thnx!!
VIEWS ON THIS POST

255

Posted on:

Thursday 11th October 2012
View Replies!

Multiple image uploader - problem uploading a single image

Basically what I've got is a problem when I'm trying to upload an image in an 'edit' page via the cms.I have 6 images that are uploaded fine via a 'add product' page, then when I go to my edit page and for example change 1 of those images of the 6 and upload that, I get problems, but all is fine if when im in the 'edit' page I change another piece of data and submit.I have included below the 2 pages that are used when 'editing' a selection.IF NOT rsuserU.EOF THENartTitle = rsuserU( "art_Title" )artCategory = rsuserU( "art_Category" )artBriefDesc = rsuserU( "art_BDescription" )artPrice = rsuserU( "art_Price" )artPicFull = rsuserU( "art_ThumbFull" )artFace = rsuserU( "art_ThumbFace" )artHood = rsuserU( "art_ThumbHood" )artExtra1 = rsuserU( "image_Extra1" )artExtra2 = rsuserU( "image_Extra2" )artExtra3 = rsuserU( "image_Extra3" )artCaseDesc = rsuserU( "case_Text" )artDialDesc = rsuserU( "dial_Text" )artMovementDesc = rsuserU( "movement_Text" )artMakerDesc = rsuserU( "maker_Text" )artDatDesc = rsuserU( "dat_Text" )artHeightDesc = rsuserU( "height_Text" )artStatus = rsuserU( "art_Status" )artMoonDisplay = rsuserU( "art_MoonDisplay" )artDisplay = rsuserU( "art_Display" )END IFrsuserU.CloseFUNCTION SELECTED( firstVal, secondVal )\t\tIF cSTR( firstVal ) = cSTR( secondVal ) THEN\t\t\t\tSELECTED = " SELECTED "\t\tEND IFEND FUNCTION%>\t\t\t\tEdit or Update Clock Information: \t\t\t\tTitle: \t\t\t\t\t\t\t\tCategory: \t\t\t\t\t\t\t\t\t\t\t\t\tLongcase Mahogany\t\t\t\t\tLongcase Oak\t\t\t\t\tLongcase Walnut\t\t\t\t\tLongcase Marquetry\t\t\t\t\tLongcase Lacquer\t\t\t\t\tLongcase Miscellaneous\t\t\t\t\tOther clocks and instruments\t\t\t\t\tBarometers\t\t\t\t\tRestoration\t\t\t\t\tLongcase Mahogany Archive\t\t\t\t\tLongcase Oak Archive\t\t\t\t\tLongcase Walnut Archive\t\t\t\t\tLongcase Marquetry Archive\t\t\t\t\tLongcase Lacquer Archive\t\t\t\t\tLongcase Miscellaneous Archive\t\t\t\t\tOther clocks and instruments Archive\t\t\t\t\tBarometers Archive\t\t\t\t\t\tBrief Description: \t\t\t\t\t\t\t\tPrice:\t\t\t\t\t\t\tPlease note! \tWhen changing an image, you have to change or re-load all 6 \tCurrent Full Length Clock Picture:\t \tNew Full Length Clock Picture: \t\tCurrent Clock Face Picture: \t \tNew Clock Face Picture: \t\tCurrent Clock Hood Picture: \t \tNew Clock Hood Picture: \t\tCurrent Extra Picture 1: \t \tNew Extra Picture 1: \t\tCurrent Extra Picture 2: \t \tNew Extra Picture 2: \t\tCurrent Extra Picture 3: \t \tNew Extra Picture 3: \t\tPlease note! \tWhen changing an image, you have to change or re-load all 6\t\tCase Description:\t\t\t\t\t\t\t\tDial Description:\t\t\t\t\t\t\t\tMovement Description: \t\t\t\t\t\t\t\tMaker Description: \t\t\t\t\t\t\t\tDate Description: \t\t\t\t\t\t\t\tHeight Description: \t\t\t\t\t\t\tStatus:\t\t\tIN STOCK\t\tSOLD\t\tMoon Image Display:\t\t\tYES\t\tNO\t\tDisplay:\t\t\tYES\t\tNO\t\tBack \t\t\t\t\t\t\t\t\t\t\tThis is then submitted here:if instr(Trim(Request.ServerVariables("HTTP_REFERER")),"addproduct_art.asp") or instr(Trim(Request.ServerVariables("HTTP_REFERER")),"updateproduct_art.asp") then\t\tSet Upload = Server.CreateObject("Persits.Upload")\t\ttheCount = upload.save(server.mappath("..")&"\images\uploaded")\t\t\t\tdim arr(6), i\t\ti = 1\t\tFor Each File in Upload.Files\tarr(i) =\tFile.FileName\ti = i + 1\t\t \t\tNext\t\t\t\t'Count = Upload.SaveVirtual("../upload")\t\t\t\t' Get the form variables\t\taddProduct = TRIM (Upload.Form("addProduct"))\t\tupdateProduct = TRIM (Upload.Form("updateProduct"))\t\tdeleteProduct = TRIM (Upload.Form("deleteProduct"))\t\t\t\t'response.write("delete=" & deleteProduct)\t\t\t\tdelID = TRIM (Upload.Form("delID"))\t\tcatID = TRIM (Upload.Form("catID"))\t\tartTitle = TRIM (Upload.Form("artTitle"))\t\tartCategory = TRIM (Upload.Form("artCategory"))\t\tartBriefDesc = TRIM (Upload.Form("artBriefDesc"))\t\tartPrice = TRIM (Upload.Form("artPrice"))\t\tartPicFull = TRIM (arr(1))\t\tartFace = TRIM (arr(2))\t\tartHood = TRIM (arr(3))\t\tartExtra1 = TRIM (arr(4))\t\tartExtra2 = TRIM (arr(5))\t\tartExtra3 = TRIM (arr(6))\t\tartCaseDesc = TRIM (Upload.Form("artCaseDesc"))\t\tartDialDesc = TRIM (Upload.Form("artDialDesc"))\t\tartMovementDesc = TRIM (Upload.Form("artMovementDesc"))\t\tartMakerDesc = TRIM (Upload.Form("artMakerDesc"))\t\tartDatDesc = TRIM (Upload.Form("artDatDesc"))\t\tartHeightDesc = TRIM (Upload.Form("artHeightDesc"))\t\tartStatus = TRIM (Upload.Form("artStatus"))\t\tartMoonDisplay = TRIM (Upload.Form("artMoonDisplay"))\t\tartDisplay = TRIM (Upload.Form("artDisplay"))\t\torigImage = TRIM(upload.Form("origImage"))\t\torigFImage = TRIM(upload.Form("origFImage"))\t\torigHImage = TRIM(upload.Form("origHImage"))\t\torigExtra1 = TRIM(upload.Form("origExtra1"))\t\torigExtra2 = TRIM(upload.Form("origExtra2"))\t\torigExtra3 = TRIM(upload.Form("origExtra3"))\t\tset upload = nothing\t\t\t\t'Assign Default Values\t\t\t\tIF artTitle = "" THEN\t\t\t\tartTitle = "\t\t"\t\tEND IF\t\tIF artCategory = "" THEN\t\t\t\tartCategory = "\t\t"\t\tEND IF\t\tIF artBriefDesc = "" THEN\t\t\t\tartBriefDesc = "\t\t"\t\tEND IF\t\tIF artPrice = "" THEN\t\t\t\tartPrice = "\t\t"\t\tEND IF\t\tIF artCaseDesc = "" THEN\t\t\t\tartCaseDesc = "\t\t"\t\tEND IF\t\tIF artDialDesc = "" THEN\t\t\t\tartDialDesc = "\t\t"\t\tEND IF\t\tIF artMovementDesc = "" THEN\t\t\t\tartMovementDesc = "\t\t"\t\tEND IF\t\tIF artMakerDesc = "" THEN\t\t\t\tartMakerDesc = "\t\t"\t\tEND IF\t\tIF artDatDesc = "" THEN\t\t\t\tartDatDesc = "\t\t"\t\tEND IF\t\tIF artHeightDesc = "" THEN\t\t\t\tartHeightDesc = "\t\t"\t\tEND IF\t\tIF artStatus = "" THEN\t\t\t\tartStatus = "\t\t"\t\tEND IF\t\tIF artMoonDisplay = "" THEN\t\t\t\tartMoonDisplay = "\t\t"\t\tEND IF\t\tIF artDisplay = "" THEN\t\t\t\tartDisplay = "\t\t"\t\tEND IF\t\t' Add new product\t\t\t\t\t\tif artPicFull = "" then\t\t\t\t\t\tPimage = origImage\t\t\t\telse\t\t\t\t\t\tPimage = artPicFull\t\t\t\tend if\t\t\t\tif artFace = "" then\t\t\t\t\t\tFimage = origFImage\t\t\t\telse\t\t\t\t\t\tFimage = artFace\t\t\t\tend if\t\t\t\t\t\tif artHood = "" then\t\t\t\t\t\tHimage = origHImage\t\t\t\telse\t\t\t\t\t\tHimage = artHood\t\t\t\tend if\t\t\t\t\t\t\t\tif artExtra1 = "" then\t\t\t\t\t\tExtra1 = origExtra1\t\t\t\telse\t\t\t\t\t\tExtra1 = artExtra1\t\t\t\tend if\t\t\t\tif artExtra2 = "" then\t\t\t\t\t\tExtra2 = origExtra2\t\t\t\telse\t\t\t\t\t\tExtra2 = artExtra2\t\t\t\tend if\t\t\t\tif artExtra3 = "" then\t\t\t\t\t\tExtra3 = origExtra3\t\t\t\telse\t\t\t\t\t\tExtra3 = artExtra3\t\t\t\tend if\t\t\t\tif addProduct "" then\t\tstrsqlM = "INSERT INTO eventDisplay " &_\t\t\t\t"( art_Title, art_Category, art_BDescription, art_Price, art_ThumbFull, art_ThumbFace, art_ThumbHood, image_Extra1, image_Extra2, image_Extra3, case_Text, dial_Text, movement_Text, maker_Text, dat_Text, height_Text, art_Status, art_MoonDisplay, art_Display\t) VALUES (" &_\t\t\t\t\t\t" '" & fixQuotes (artTitle ) & "', " &_\t\t\t\t" '" & fixQuotes (artCategory ) & "', " &_\t\t\t\t" '" & fixQuotes (artBriefDesc ) & "', " &_\t\t\t\t" '" & fixQuotes (artPrice ) & "', " &_\t\t\t\t" '" & fixQuotes (artPicFull ) & "', " &_\t\t\t\t" '" & fixQuotes (artFace ) & "', " &_\t\t\t\t" '" & fixQuotes (artHood ) & "', " &_\t\t\t\t" '" & fixQuotes (artExtra1 ) & "', " &_\t\t\t\t" '" & fixQuotes (artExtra2 ) & "', " &_\t\t\t\t" '" & fixQuotes (artExtra3 ) & "', " &_\t\t\t\t" '" & fixQuotes (artCaseDesc ) & "', " &_\t\t\t\t" '" & fixQuotes (artDialDesc ) & "', " &_\t\t\t\t" '" & fixQuotes (artMovementDesc ) & "', " &_\t\t\t\t" '" & fixQuotes (artMakerDesc ) & "', " &_\t\t\t\t" '" & fixQuotes (artDatDesc ) & "', " &_\t\t\t\t" '" & fixQuotes (artHeightDesc ) & "', " &_\t\t\t\t" '" & fixQuotes (artStatus ) & "', " &_\t\t\t\t" " & fixQuotes (artMoonDisplay ) & ", " &_\t\t\t\t" " & fixQuotes (artDisplay ) & " )"\t\t\t\t\t\t\t\t\t\t\t\t'rsuser.open strsql, conn\t\tOn Error Resume NextConnM.Execute strsqlMIf Err 0 Then\tResponse.Write "Error in query " & strsqlM\tResponse.EndEnd If\t\t\t\tend if\t\t%>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\tClock Title:\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\tCategory: \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBrief Description:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPrice:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPicture of full length:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tPicture of the face:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tPicture of the hood:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tExtra Image 1:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tExtra Image 2:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tExtra Image 3:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tCase Description:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tDial Description:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tMovement Description:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tMaker Description:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tDate Description:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tHeight Description:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tStatus:\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tMoon Display:\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\tDisplay:\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\tWas added to the database \t\t\t\t\t\t\t\t\t\t\t\t\t
VIEWS ON THIS POST

306

Posted on:

Monday 15th October 2012
View Replies!

asp uploader

Hi all,I have PWS running on a windows 98 machine.\tI am trying to get something to make an upload via html/asp but everything i try is not working (looked on net for code).Could it be that i dont have access to the server from htmlHow do i give it access if so\tIf it isnt this, what could it beTIADan ----------------------------------------There are 2 types of computer, the prototype and the obsolete!!
VIEWS ON THIS POST

201

Posted on:

Tuesday 16th October 2012
View Replies!

File uploader

,I was wondering if anyone could advise me on the best way forward with a potential piece of development I am facing.I would like a user to be able to locate an image stored on their machine and for that image to be copied across to a location on a directory on the web server. I would prefer to do this via an ASP page.I am unsure of the best place to start, and so if anyone has any pointers/ helpful references etc etc they would be much appreciated
VIEWS ON THIS POST

268

Posted on:

Tuesday 16th October 2012
View Replies!

Upload pdfs shadow script

I am uploading 12 pdfs using shadow upload script here is my code Code: Set objUpload=New ShadowUpload If objUpload.GetError"" Then Response.Write("Sorry, could not upload: "&objUpload.GetError) Else For x=0 To objUpload.FileCount-1 Call objUpload.File(x).SaveToDisk("F:\Inetpub\WWWRoot\pdfs\", "") Next End If How do i get the names of the pdfs there will not always be 12 pdfs sometimes there will be 2 sometimes 5 any idea
VIEWS ON THIS POST

352

Posted on:

Friday 26th October 2012
View Replies!

Shadow uploader ??

i'm having a problem with end users submitting more then one photo for there number, the problem is it doesn't rename the second file. it only renames the first file they upload. is there a way to have the second file renamed 71b.jpg or something like that. instead of just uploading it with out renaming it
VIEWS ON THIS POST

287

Posted on:

Friday 26th October 2012
View Replies!

Error when using shadow uploader

I have a login page where user enters his username password i verify if he is a valid user or not if he is i redirect him to a diff page and in querystring i transfer 3 variables ok I get the 3 variables on that page then i have 3 radio buttons when user selects one of them i display the company name and they upload the file and some stas for the company the client requirement is when the user submits the form it should be done by radio button not a submit button for uploading of file i have used shadow's code here is my problem if the user doesnt upload a file it gives me an error saying Microsoft VBScript runtime error '800a01a8' Object required: 'm_Request' /ERP/onlineerp/ShadowUploader.asp, line 27 here is the code for it [CODE] Company Details Country U.S.A Canada International Company name Stats Upload File /> now i have the code for submitcompany.asp Code:
VIEWS ON THIS POST

374

Posted on:

Friday 26th October 2012
View Replies!