• Resolved lesnic

    (@lesnic)


    Hi!
    Defolt upload directory is: /wp-content/uploads/…
    For securyty reason it’s possible change upload directory on someting like: /images/uploads/ ?
    Thank You for work!
    Nick

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author ovann86

    (@ovann86)

    Hey,

    It looks like you can define a new upload directory by adding

    define('UPLOADS', 'images/uploads');

    at the bottom of your wp-config.php file.

    But it would be worth testing before putting this on your production website (e.g. how does this affect existing uploads and other plugins).

    It’s a standard WordPress configuration, but it doesn’t look like it works with the native Gravity Forms upload fields so if you also use the standard upload fields it would be worth testing and submitting a support ticket with them.

    I’m not really sure how it’ll provide better security for you though? If you’re wanting to hide the upload directory/s make sure you configure a hash option in the upload path (in the wp-admin Forms -> Settings -> Ajax Upload menu).

    Just a note about WordPress file upload security/privacy … by default there is little to none in WordPress but Gravity Forms has started to add a a method to protect uploaded files from being discovered at random (e.g. guessing a file path) — but last I checked it was only half implemented. I’ll be merging the same method into this plugin once it’s stable.

    If you haven’t already, it would be worth reading the advice here: https://www.gravityhelp.com/documentation/article/security/#file-upload-security

    I see they’re promoting the ‘Secure Download Locations’ feature/method now – so I’ll need to revisit that to see if it’s now stable.

    • This reply was modified 9 years, 5 months ago by ovann86.
    • This reply was modified 9 years, 5 months ago by ovann86.
    Thread Starter lesnic

    (@lesnic)

    Thank You for help!
    All work good!

    About “security upload” category: For me is important that when user upload foto and roll over thumbnail images it’s impossible see ” way” to upload directory on word press installation. For example: i upload foto on your demo site, and i can see that foto is on:
    https://demo.itsupportguides.com/ajax-upload-for-gravity-forms/wp-content/uploads/sites/12/gravity_forms/2-48d3264e554f55de475657af2fcb880c/01/2017/thumbnail/Ajax%20Upload%20Field_19_2.jpg
    If i manualy delete /thumbnail/ i can see “full” foto.
    I pefer tht user can’t see that foto is on wordpress directory.

    Another question:
    After last update to 2.4.4 sometime i have: “Error uploading file message” when uploading foto from iPhone.
    But on your drmo site all work. Dou you have last version of plugin on demo site?

    Have nice day!

    Nick

    Plugin Author ovann86

    (@ovann86)

    Yes, I agree about not using wp-content – also looks more professional (for those that look at the detail).

    RE: version on demo website.

    Yes and no. Yes it was the old version – but the code should have been the same because I develop on the demo website.

    I have had issues with uploads continuing to fail in the past, wasn’t really sure what caused or resolved it for me. I recall upgrading the ‘ajax upload’ software this plugin is based on, which may have helped. Perhaps it’s time to do it again … there might be a bug at play.

    I have just installed the latest version on the demo website – can you check if you get failed uploads when using the iphone? I’ve got an ipad here so ill check on that as well.

    Plugin Author ovann86

    (@ovann86)

    So I’m not having any issues on the demo site using my ipad, but I did remember one other thing I looked at when I was having issues …

    In the Forms -> Settings -> Ajax Upload wp-admin menu you’ll find an option at the bottom for ‘chunked uploads’ – it is probably set to 0.

    It’s possible, especially if the files are large, that the process of uploading to the server is timing out – changing the chunk option will spread the upload over several upload requests. Perhaps it’s worth changing it to a low number like 1 or 2?

    Also, just adding here (mostly for my reference) there’s an option to add in automatic retry on fail … but I’m not sure if it adds too much complexity for the benefit

    https://github.com/blueimp/jQuery-File-Upload/wiki/Chunked-file-uploads#automatic-resume

    • This reply was modified 9 years, 5 months ago by ovann86.
    Thread Starter lesnic

    (@lesnic)

    Ok, i think it’s some problem whit upload.
    Now if i try upload foto from my iPhone on your demo site i see:
    Error uploading file
    HTTP/2.0 500
    Internal Server Error (500)
    On my site when i upload from PC/Mac all work good,
    But i try send foto from iPone library i see
    Error uploading file
    SyntaxError:JSON Parse error:
    Unexpected identifier “libgomp”
    Request JSON parse failed.

    And if i try use for foto Shoot directly from cam i see
    Error: ReferenceError:Can’t find variable:cbStickySB
    URL:……..

    I think this happend after last Gravity form update.
    Now i try make downgrade for gravity form.

    Thread Starter lesnic

    (@lesnic)

    Ok, i try change chunk option number, but still have error when i try upload from iPhone
    This is my test page:
    http://www.magnoliatv.it/cast/gentest/
    Work good on PC/Mac but not on iPhone

    Two day ago upload work good.
    Now i need see what i change on site.

    Plugin Author ovann86

    (@ovann86)

    Well I’ve got good news, I think …

    I just tried uploading jpg files using my ipad on both chrome and safari and it worked fine – so perhaps it’s an issue specific to your i-device.

    One thing you might want to think about … limiting the file types to just jpg might not be too good for your users – many people dont know the difference between jpg/jpeg/png etc

    Personally I would make it so all image types are allowed and if you need a particular format for how you work with the files you can worry about that. That is, I prefer to make things easier for the user.

    Plugin Author ovann86

    (@ovann86)

    Hey again,

    I just saw the error message you shared.

    There’s two errors there –

    The 500 error, which means your server had an issue.

    And the upload script – because it saw the 500 error instead of the uploaded file.

    The 500 error is 100% a server issue, but it must be intermittent if you’re not seeing it all the time. Odd.

    Thread Starter lesnic

    (@lesnic)

    Yes!
    I try upload foto from iPhone library and all it’s Ok.
    If i take foto from camera ( iPhone7 ) i have error.
    On your demo site all work

    Maybe picture is too big.
    Thank you for HELP!

    Have nice day!

    Nick

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘how change directory: /wp-content/uploads/’ is closed to new replies.