Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when create new item - Net::FTPPermError (550 Failed to change directory. ) #32

Open
dnt294 opened this issue Nov 15, 2016 · 1 comment

Comments

@dnt294
Copy link

dnt294 commented Nov 15, 2016

Hi , I'm setting up FTP server on a Ubuntu 16.04 in Virtual box with vsftpd.

I can use Windows Explorer to access to the FTP folder, as well as from Ruby code.

image

But I can't get it done with your Gem. whenever I try to upload a new file, it always returns error in the title.

image

Here's my CarrierWave config

CarrierWave.configure do |config|
    config.storage = :file
    config.asset_host = ActionController::Base.asset_host

    config.ftp_host = '192.168.1.101'
    config.ftp_port = 21
    config.ftp_user = 'tom'
    config.ftp_passwd = '1'
    config.ftp_folder = "Desktop/public"   # doesn't work neither with '/Desktop/public'
    config.ftp_url = "http://192.168.1.101/"
    config.ftp_passive = false # false by default

end

Thanks for any help :(

@hcfairbanks
Copy link

I ran into a similar problem. For your config.ftp_folder try and absolute path like
"/home/deploy/Desktop/public"
For your uploader file try
"images/users/avatar"
In this scenario the full path of where the files will get written is
/home/deploy/Desktop/public/images/users/avatar/some_file.jpg
I set my vsftp up with this tutorial
but they failed to mention that this config configuration is read only
to give your user write permissions adjust the vsftpd.conf file
vi /etc/vsftpd.conf
write_enabled=YES
The other thing I noticed is that the return path for carrierwave didn't have the proper ip address, so you may need to create your own link's with your objects in mind and what ip the file was attached to. I plan on making an additional field in my users table to add not only the avatar name but the ip in which the image resides on. Then have another server running to make images publically available, that way I can split the application and the data/files for increased horizontal scalability. msg me if you have any other questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants