PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

export data

  1. kim.telenet
    Member

    Just wanted to point out a quick workaround for users that aren't able to export data because of some restriction on their server.

    In my case my server didn't allow the export script to create the export file. It does however allow the script to modify an existing file with appropriate permissions (chmod to 755 or 777).

    So this is what i did:

    1/create a file called export_data.cvs in the following folder: wp-content/uploads/gravity_forms/1/

    you might need to create these subfolders in your uploads folder; also make sure this is the folder specified as your upload folder in wp settings > Miscelaneous

    2/ in gravityforms plugin export.php change line 188

    $file_name = "export_" . time() . ".csv";to
    $file_name = "export_data.csv";
    Note: making this file static and chmodding it to 777 creates a security risk, so i would recommend choosing your own custom name for this file in stead of 'export_data.csv'.

    Note2: everytime you export a form, the data will be overwritten. To separate the different forms, you could add the form_id to the file name $file_name = "export_data_" . $form_id. ".csv"; and create a file on your server for each form you need to export.

    Note3: after a plugin upgrade, you will need to apply this hack again.

    Posted 14 years ago on Thursday January 21, 2010 | Permalink
  2. So your hosting does not allow scripts to create files despite the fact the proper permissions have been placed on the directory on the server? Very odd.

    Who is your web host? Did they give an explanation as to why? Seems very limiting.

    Posted 14 years ago on Thursday January 21, 2010 | Permalink
  3. kim.telenet
    Member

    I asked my web host about this, but haven't heard from them yet. It also prevents the use of wp automatic update and automatic plugin update. It is indeed very limiting. I'm hoping that they fix this, but in the meantime I'm glad i was able to export the file.

    Posted 14 years ago on Thursday January 21, 2010 | Permalink
  4. They shouldn't be preventing PHP from creating files like this, especially if your permissions are correct. But we also discover quirks with various web hosts, everyone does things differently.

    Please keep us posted when you hear back from your host. I'm interested in hearing what the issue and fix is.

    Posted 14 years ago on Thursday January 21, 2010 | Permalink