test
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • hkocowin Friend
    #206122

    Hello, I would like to use this component to minimize the storage in my server which allows users to upload images.
    When I tried uploading the files to S3 and then delete them in the local server, my photo album component cannot find the files as it uses ‘JFile::exists’ to look for them before displaying.

    Is there any way to deal with it? I’m thinking maybe I can modify this component to create empty files instead of deleting…

    Also, can I specify the upload options for cron job so I can free up the local storage after uploading the files?

    Thanks.

    Thanh Nguyen Viet Friend
    #569732

    Hello hkocowin,

    <blockquote>Is there any way to deal with it? I’m thinking maybe I can modify this component to create empty files instead of deleting…</blockquote>

    Yes, it might be the simplest solution for this case, you will need create empty/blank files to replace for removed files.
    But this solution only help to pass a function to check if file exists, it might face some unexpected results if your extensions do other tasks such as create thumbnail or get file size, …

    I have created issue for this feature on our issue tracker system, and our development team will check and implement it for next version if we find stable solution.
    You can check status of this issue here http://pm.joomlart.com/browse/JAECCOMAMAZONJIVI-105

    <blockquote>Also, can I specify the upload options for cron job so I can free up the local storage after uploading the files?</blockquote>
    There is no options for upload mode with cron job now, Cron job only upload new and modified files to S3.
    to enable deleting local file mode for cron job, please follow step below:

    administrator/components/com_jaamazons3/cron.php

    Find this code snippet

    [PHP]$ctrlRepo->_upload($uploadToken, $profile, $uploadFolder, 2);[/PHP]

    And replace it with:

    [PHP]$ctrlRepo->_upload($uploadToken, $profile, $uploadFolder, 3);[/PHP]

    hkocowin Friend
    #570063

    <em>@Dead Code 472262 wrote:</em><blockquote>
    Yes, it might be the simplest solution for this case, you will need create empty/blank files to replace for removed files.
    But this solution only help to pass a function to check if file exists, it might face some unexpected results if your extensions do other tasks such as create thumbnail or get file size, …

    </blockquote>

    Thank you for the reply!
    I may try to do that myself while waiting for your solution. One question is, if I create empty files, does it mean I cannot use the ‘upload new and modified fiels to S3’ function? Otherwise, the files in S3 will be replaced by the blank files I guess?

    Also, if I change the parameter to ‘3’ for the Cron job, will it upload modified files as well?

    hkocowin Friend
    #735135

    <em>@Dead Code 472262 wrote:</em><blockquote>
    Yes, it might be the simplest solution for this case, you will need create empty/blank files to replace for removed files.
    But this solution only help to pass a function to check if file exists, it might face some unexpected results if your extensions do other tasks such as create thumbnail or get file size, …

    </blockquote>

    Thank you for the reply!
    I may try to do that myself while waiting for your solution. One question is, if I create empty files, does it mean I cannot use the ‘upload new and modified fiels to S3’ function? Otherwise, the files in S3 will be replaced by the blank files I guess?

    Also, if I change the parameter to ‘3’ for the Cron job, will it upload modified files as well?

    Thanh Nguyen Viet Friend
    #570064

    Hello,

    Yes, you also need update upload function to check file size and ignore empty files for the option “Upload New & modified files”, or you must use option “Upload New files only”.

    <blockquote>Also, if I change the parameter to ‘3’ for the Cron job, will it upload modified files as well? </blockquote>
    Yes, if you upload with this mode, all local files will be removed after uploading to S3, so by default all files in your server are new files, and it will be uploaded to S3, we do not check file md5 checksum in this case.
    But if you update upload function to ignore empty files as mentioned above, it can help to fix this issue also.

    Thanh Nguyen Viet Friend
    #735136

    Hello,

    Yes, you also need update upload function to check file size and ignore empty files for the option “Upload New & modified files”, or you must use option “Upload New files only”.

    <blockquote>Also, if I change the parameter to ‘3’ for the Cron job, will it upload modified files as well? </blockquote>
    Yes, if you upload with this mode, all local files will be removed after uploading to S3, so by default all files in your server are new files, and it will be uploaded to S3, we do not check file md5 checksum in this case.
    But if you update upload function to ignore empty files as mentioned above, it can help to fix this issue also.

Viewing 6 posts - 1 through 6 (of 6 total)

This topic contains 6 replies, has 2 voices, and was last updated by  Thanh Nguyen Viet 9 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum