Announcement

Collapse
No announcement yet.

BUG: file uploading in SC6

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

  • BUG: file uploading in SC6

    I am using sc6 and made a file upload form named grid_filestorage
    So sc makes me a file called grid_filestorage.php

    When this file is made directly when I use scriptcase the following is hte beginning of the file:
    <?php
    //
    include_once('grid_filestorage_session.php');
    @session_start() ;
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_perfil'] = "";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_prod'] = "/scriptcase/prod";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_imagens'] = "/scriptcase/file/img";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_imag_temp'] = "/scriptcase/tmp";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc'] = "C:/storage/";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_conexao'] = "conn_oracle";
    ....

    When this file is created via deployment then this is created:
    <?php
    //
    include_once('grid_filestorage_session.php');
    @session_start() ;
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_perfil'] = "conn_oracle";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_prod'] = "";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_imagens'] = "";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_imag_temp'] = "";
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc'] = "";
    //

    This is of course totally incorrect!!
    This line: $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc'] = "C:/storage/";
    should be the same when deployed as with the direct scriptcase.

    I so wish you would fix the bugs in sc6 as well... This is surely another one.

  • #2
    upon investigation I noticed that these lines in the genereated code:
    $this->path_prod = $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_prod'];
    $this->path_imagens = $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_imagens'];
    $this->path_imag_temp = $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_imag_temp'];
    $this->path_doc = $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc'];
    are coming BEFORE the piece of code for the OnApplicationInit

    A bit later on there is this code:
    $_SESSION['sc_session'][$this->sc_page]['grid_filestorage']['path_doc'] = $this->path_doc;
    still with the wrong $this->path_doc

    Only about 100 lines lines after that the OnApplicationInit is called.
    So the result is basically that whatever I try, it will ALWAYS be set to empty.

    Basically because:
    1:Line 9 See previous post: the initialisation is WRONG it should be filled!!!!
    $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc'] = "";


    line 273:the generation follows the line
    //check doc
    if(empty($_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc']))
    {
    /*check doc*/$_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc'] = $str_path_apl_dir . "_lib/file/doc";
    }

    line 285:this line of course then is pointing to my _lib/file/doc of the application I made since it was empty to begin with
    $this->path_doc = $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc'];

    line 410: since the path is wrong the followinf goes wrong
    $_SESSION['sc_session'][$this->sc_page]['grid_filestorage']['path_doc'] = $this->path_doc;

    line 510 my OnApplicationInit properly replies my application doc path
    echo 'Session path=' . $_SESSION['scriptcase']['grid_filestorage']['glo_nm_path_doc'] . "<br>";
    and even tho I set it here to be something else it is already to late since it is set at line 410.

    So basically the code that is generated is also wrong in that way.
    All would be fine if the first lines were to be generated properly. They are NOT tho.
    Now if you look carefully you see that the other paths are ALSO not filled in. Meaning it will also fail for example with image fields.

    Hence my conclusion that the code generator has a bug.

    I use a form with Editable Grid orientation
    on it is a FILENAME (Document filename) and a SUBFOLDER as type text which I want to use as the subfolder in which to place my files.
    On the Application settings the documents path is c:/storage/ the FILENAME has a subfolder [sc_upload_subfolder] which is properly generated.

    So for people that are using sc7, a small warning. This bug may have been propagated into sc7 as well...

    Comment


    • #3
      Hello rr,

      So the issue only happens if you try to use a global variable to set the subfolder in order to upload files?

      Issue reported to our bugs team.

      regards,
      Bernhard Bernsmann

      Comment


      • #4
        I would store the whole story in your mantis database. This is one of the best documented bugs available. We are changing the uploadfolder, haven't tried it with a fixed path. But paths are generated empty.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          Fixed paths will also fail.. Basically the generated code is simply incorrect. And this goes also for any other type of form window I create with the upload document field.
          It can be verified quickly. Simply make a form with an upload field, generate and test, then deploy en check the main .php code (not the _apl.php).
          Just follow the generated code logic and you'll quickly verify the bug as I have described.
          Interestingly enough on ALL our deployed forms those initilisations in the first called php are empty, always.... So I'd say there is proof enough...
          The application path settings are simply not in the deployment. The only thing that is set is the database connection.

          Comment


          • #6
            is anybody noticing this bug, or still in pending
            Website Design

            Comment


            • #7
              I have the same problem, i cannot tell in details like "rr" but my program is not working to upload files in PRODUCTION, SCRIPTCASE PLZ HEEEEELLLLPPPPPP.....

              or what to do ???

              I am not a big programmer so i will not fix something that is broken in the product that i PAY for.........................

              Comment


              • #8
                Hello guys,

                I will verify the bug status with our team.

                regards,
                Bernhard Bernsmann

                Comment


                • #9
                  Please Mr. Bartho,

                  its really need to fix, I am very upset with it, I am using scriptcase since v5 and since that time I couldn't deliver the image upload application.
                  thanks...
                  Website Design

                  Comment


                  • #10
                    Please S.O.S fix this problem!!!

                    Comment


                    • #11
                      So is this ever going to be fixed ????

                      Comment


                      • #12
                        Problem:
                        ------------------------------
                        When we upload an image with file-field, the image was uploaded in tmp-directory, but not transferred in image-directory. Result: The image can't be displayed.

                        On the local system (WAMP with PHP 5.3) it works.

                        Environment of the production-server: PHP 5.4 on 1and1-Hosting-Provider

                        Work-Arround (solution?):
                        ------------------------------
                        The problem lies in the lack of time zone definition!

                        We have changed the third-party-Modul "…\scriptcase7\devel\lib\third\blueimp\index.p hp"

                        Now, we call the "date_default_timezone_set"-function – after the "error_reporting-call".

                        for example:
                        error_reporting(E_ALL | E_STRICT);
                        date_default_timezone_set('Europe/Berlin'); <-------

                        This index.php is a template for the scriptcase-generation. And now scriptcase generate the code with this date_default_timezone_set-call.

                        AFTER GENERATION ALL MODULES -> IT WORKS :-)

                        I do not know if this solution applies generally. For us, this work-arround works and we will also sent this work-arround to SCRIPTCASE.
                        this is the final solution, and its working for me,

                        Environment:
                        Windows Server 2008
                        php-v5.2

                        check out and let us know, if its work for you no no.

                        regards...
                        Website Design

                        Comment


                        • #13
                          For me worked fine, but i think that SC team must to do this changes for programing, because when upgrade with news SC this line must be with in new code.

                          Comment


                          • #14
                            I am really disappointed because scriptcase has taken so long and still not fixed this bug. Many developers depend on this feature to run without error. When we paid for the software license, we paid a full amount expecting the software would perform as it must. scirptcase company: Please fix this error or think about compensating your customers it has takenn too long.

                            Comment


                            • #15
                              Specially since I gave more then enough detail for them to fix this bug... I guess they dont wont ususing SC6 anymore....

                              Comment

                              Working...
                              X