Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Let's avatar
Level 4

Connect to Digital Ocean droplet using FTP (I know not secure but I need it)

Hi,

I use Sam Broadcaster to play radio over my website. This software can tell my website which title is currently playing. After each song, it uploads automatically a JSON (or XML or whatever format you want) containing current playing title and history, and some other info (you can add your own). I use PHP (a webservice pulled by ajax) to read and parse the file. Yeah, it's a great software.

Anyway, it can only upload via FTP. And yes, I really need this feature.

Is there a way to allow FTP for a custom directory only?

- AwesomeWebsite
     - app
     - ...
     - storage
          - app
          - Sam Broadcaster

I want to enable FTP for the directory AwesomeWebsite/storage/Sam Broadcaster ONLY. What do I mean? I just want Sam Broadcaster to upload the file there and that's all. No commands (like cd or such thing) allowed.

Can anyone help me? Thanks.

0 likes
8 replies
krekas's avatar

You can install ProFTPD package. Then create user with home directory that you want, in your example AwesomeWebsite/storage/Sam Broadcaster and in /etc/proftpd.conf write

DefaultRoot ~

I think it should work.

richard@gorbutt.com's avatar

I haven't used SAM for many years (I migrated to another automation playout for mine) but if I recall, it can send the metadata to a URL (or there was a PAL script to do that, bit fuzzy now).

I then created, then, simple PHP to read the GET data and enter into a MYSQL database .

Dig on the SpacialAudio forums for info on sending metadata to a URL (either a GET or POST).

Let's avatar
Level 4

Ham, I prefer FTP because I have an output template already well-parsed by my PHP code. So I'll continue digging this to make it work instead..

Well, I'm following this tutorial now: https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-on-ubuntu-12-04

After all installed and configured, when I run this netstat -ant | grep 21, it outputs

tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN 

But when I do ftp [myip], it outputs

ftp: Can't connect to `[myip]`: Operation timed out
ftp: Can't connect to `[myip]`

How come? Please :), thank you

Sys32's avatar

If you want something more secure, use SFTP, port 22 in filezilla when connecting. And connect using the user running the webserver, ie. apache, www-data etc. Or root, like every other lazy developer using a droplet test environment :D

andcl85's avatar

@Let A bit late to the party, but... How did you chrooted the new FTP user to that specific '/storage/SAM Broadcaster' directory inside Laravel?? I am in the same situation and I can't figure out how... Thanks in advance.

1 like
JeffreyW's avatar

Hello,

I'm not sure, but for the no-code approach, you can try third-party data integration tools for your task.

As far as I know, Skyvia can perform such kind of integration with no coding needed You can read more here - https://skyvia.com/connectors/digitalocean

Hope it helps

Please or to participate in this conversation.