Announcement

Collapse
No announcement yet.

Photo img problem

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Photo img problem

    In my form i have a photo field stored as blob in db, after i choose the img file nothing will happen.. what could be the problem? In my apache log i see this
    Code:
    File does not exist: /www/yyy/_lib/tmp/sc_cb814407_ava-10-100x100.jpg
    Last edited by Clauu; 01-19-2014, 01:42 PM.

  • #2
    Any help on this please? This img issue is the only thing keeping me on from finishing my form.

    Comment


    • #3
      Are you trying to upload?? This does not look like a standard download location..

      Comment


      • #4
        Yes, selecting the img file for upload in my form does nothing, that apache error log is from jquery trying to show me a thumbnail after choosing the file.

        Comment


        • #5
          I assume the rights to that tmp dir are ok and that it does exist (check please).
          Can you monitor the dir when you uplaod a file?? The name that appears suggests that it at least did something..

          Comment


          • #6
            Yes, web user has full acces to tmp dir, anyway it;s 777 to everyone.
            I already did that, dir lastchanged date remains the same so there is no data writen to it, maybe the problem is from php uploader class since jquery triggers ajax php that isn't touching in anyway that tmp dir.. i will take a look at it.
            Last edited by Clauu; 01-21-2014, 06:14 AM.

            Comment


            • #7
              Ok so i'm out of ideas, with a simple form i can easily upload any image to the server but with scriptcase i can not, paths are valid, directories are accesible by everyone so what could be the problem?

              Comment


              • #8
                Did you use advanced deploy? There you have to set the paths for the deployment. Since you are working with images/files it is important to set those. I did that wrong myself.
                If you just use a typical deployment then the paths are not filled. In that case defaults are used. You can simply add some basic php in your generated code to see where it fails or do the cowards way (as I dao) install on a local machine. Then install xdebug in your php and 'simply' (it takes time...) debug through the code..
                Now I never used upload as blob only as file so this is just my best guess.
                Apart from that you should be aware of it being a real BLOB not one that gets converted (CLOB for example) to another characterset.

                Comment


                • #9
                  This issue is in both development and production environment, i have debuged some code upload.class.php and here is some data from 'post()' method
                  Code:
                  $this->options var
                  Array
                  (
                      [script_url] => http://scriptcase/scriptcase/app/claudiu/edit/        ;ok
                      [upload_dir] => /www/scriptcase/tmp/                                  ;ok&writable
                      [upload_url] => http://scriptcase/scriptcase/tmp/                     ;ok&writable
                      [param_name] => photo
                      [max_file_size] => 
                      [min_file_size] => 1
                      [accept_file_types] => /.+$/i
                      [max_number_of_files] => 
                      [discard_aborted_uploads] => 1
                      [orient_image] => 
                      [image_versions] => Array
                          (
                          )
                  
                      [upload_file_height] => 0
                      [upload_file_width] => 0
                      [upload_file_aspect] => S
                      [upload_file_type] => I
                  )
                  Code:
                  $upload var
                  Array
                  (
                      [name] => Array
                          (
                              [0] => ava-10-100x100.jpg        ;ok
                          )
                  
                      [type] => Array
                          (
                              [0] => 
                          )
                  
                      [tmp_name] => Array
                          (
                              [0] => 
                          )
                  
                      [error] => Array
                          (
                              [0] => 1
                          )
                  
                      [size] => Array
                          (
                              [0] => 0
                          )
                  
                  )
                  Last edited by Clauu; 01-30-2014, 02:22 PM.

                  Comment


                  • #10
                    I have only done file uploads, not blob uploads. So this is all guesswork now. But since you can debug in php you should be able to find a piece of code that kinda looks like this:

                    $dir_doc = $this->Ini->path_doc . "" . "/";
                    if (nm_mkdir($dir_doc))
                    {
                    $arq_filename_ = fopen($this->SC_DOC_filename_, "r") ;
                    $reg_filename_ = fread($arq_filename_, filesize($this->SC_DOC_filename_)) ;
                    fclose($arq_filename_) ;
                    $arq_filename_ = fopen($dir_doc . trim($this->filename__scfile_name), "w") ;
                    fwrite($arq_filename_, $reg_filename_) ;
                    fclose($arq_filename_) ;
                    }
                    $this->sc_evento = "insert";
                    $this->NM_gera_log_key("incluir");
                    $this->NM_gera_log_new();
                    It is in your projectname_apl.php code... For me at about line 3654. Try setting a breakpoint on the fopen or better yet a few lines before..

                    Comment


                    • #11
                      No i don't have anything similar since i'm using blob storage.. maybe a dev could have a look at that info
                      Last edited by Clauu; 02-01-2014, 06:54 AM.

                      Comment


                      • #12
                        You didnt say which database you used... I assume in your case you use sqlite.. If so then there is another thread concerning this as well...
                        You may find thus url iteresting otherwise: http://stackoverflow.com/questions/7...bases-with-php

                        Comment


                        • #13
                          I'm using oracle but the problem is before it reaches to db insertion since the img is not loaded/uploaded

                          Comment


                          • #14
                            I guess all that is left to test is just making a stupid simple php program that writes a file to the given dir and see if it fails. If so then display the error...
                            $rs=fopen('/www/yyy/_lib/tmp/test.txt','w+');
                            fputs($rs,'some test string');
                            fclose($rs);

                            that then probably fails too... So you can have a failure in the (sub)path somewhere... Or no rights in a subpath somewhere...
                            More I wouldnt know...

                            Comment


                            • #15
                              I already did that with a simple html+php upload form and the file is moved and uploaded to the desired dir.. a dev can take a look at this please?

                              Comment

                              Working...
                              X