4 Replies Latest reply: Aug 22, 2014 8:26 AM by enrique zendejas RSS

    Error "Status code:403" al usar cffileupload

    enrique zendejas

      I using a cffileupload to upload a file into server, but the component give me an error "Status code:403". Somebody have any idea?

        • 1. Re: Error "Status code:403" al usar cffileupload
          vishu#13 Community Member

          Are you running cffileupload over https? If yes, then it is a bug in ColdFusion 10.

          Also, share the code?

          • 2. Re: Error "Status code:403" al usar cffileupload
            enrique zendejas Community Member

            thanks for your comments.

             

            I not using HTTPS yet because I working in development enviropment, and I have coldfusion 9 and Apache in the server.

             

            I have two files, the first have next code:

             

            <cfoutput>

            <script type='text/javascript'>

              var cierra=function cerrarVentana(){

              window.close();

              }

              var error_carga=function error(e){

              alert("Estado:"+e.STATUS+"\n  Mensaje: "+e.MESSAGE+"\n Archivo:"+e.FILENAME);

              }

            </script>

            <cffileupload 

                url="uf_xxx.cfm?ids=#url.ids#&fe=#url.fe#&#urlEncodedFormat(session.urltoken)#"

                progressbar="true"

                name="upload"

                addButtonLabel = "Agregar Archivo"

                clearButtonlabel = "Limpiar"

                hideUploadButton = "false"

                width=500

                height=200

                title = "Carga de archivos"

                extensionfilter="*.xls"

                BGCOLOR="##FFFFFF"

                MAXFILESELECT=1

                UPLOADBUTTONLABEL="Cargar archivo"

                onUploadComplete = cierra

                onError=error_carga

                maxuploadsize="20"

                stoponerror=true

                />

             

            the second file is uf_xxx.cfm and have the next code:

             

            <cftry>

              <cffile action="uploadAll" destination="#expandpath('../../archivo')#" nameconflict="overwrite">

                <cfset stock = createObject("component","#Application.webroot#/component")>

              <cfset res=stock.recibe_stock("#expandpath('../../archivo/#cffile.serverFileName#.xls')#",url.id s, url.fe)>

                <cfcatch type="any">

                <cfset str.STATUS = 500>

              <cfset str.MESSAGE = "Error durante la carga del archivo">

                    <cfquery datasource="db" >

                        insert into logerror values(sysdate,'error', 'error')

                    </cfquery>

                </cfcatch>

            </cftry>

             

            When I try it, the file not up and the second file not execute and in the cffileupload component appers the message "Status code: 403".

             

            I think that is a configuration issue but I not find the solution yet.

            • 3. Re: Error "Status code:403" al usar cffileupload
              vishu#13 Community Member

              Try this

               

                <cffile action="uploadAll" destination="#expandpath('../../archivo')#" nameconflict="overwrite" accept="application/vnd.ms-excel">

              • 4. Re: Error "Status code:403" al usar cffileupload
                enrique zendejas Community Member

                thanks again.

                 

                I tried your suggestion but i have the same error.