Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error "Status code:403" al usar cffileupload

New Here ,
Aug 21, 2014 Aug 21, 2014

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

477
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 22, 2014 Aug 22, 2014

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

Also, share the code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 22, 2014 Aug 22, 2014

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.ids, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 22, 2014 Aug 22, 2014

Try this

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 22, 2014 Aug 22, 2014
LATEST

thanks again.

I tried your suggestion but i have the same error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources