Reputation: 385
I'm currently working on a project which allows my employees to upload files to a private work management site that I designed, and then the site informs a publicly accessible site that new files have been uploaded, and to inform the client those files belong to.
I'm trying to figure out the "best" way to go about doing this. Obviously giving my clients access to the work management site would be a terrible idea, but the files still need to be saved on the work management site as well.
When I started working on this feature, I figured I'd just write a cron on the public site (The site clients access) to download the new files every 24 hours, but it looks like there may be hundreds of files (Hundreds of megs) every 24 hours, so I'm starting to doubt that design. I'm also a little skeptical of using ftp/sftp/scp, as that's a possible security issue. Are there other methods I'm overlooking to do this?
Note: I'm using Code Igniter on the work management site, and Laravel on the public site.
Edit: I should note that both sites will be on the same server, domain, and under the same user. Are there any issues with writing a "wrapper" which basically forwards the file data through a php script to cover the actual download location?
Upvotes: 0
Views: 75
Reputation: 4467
sftp or scp will be just about as secure as anything. Why are you skeptical of using them? You could build a VPN between the two sites, but that's likely more work and resources than using sftp or scp.
Edit: Responding to edited question -- if both sites are on the same server, does that mean they essentially share the same file system (disks)? If so, then it would make sense to simply access the same files from both sites, and write code / configure the client site to display only the files the clients should see and give them only the limited access they should have. It is possible to code this in such a way that the only access they have to the files is through the site's code, yes. For example, this is a standard on/off configuration option in Drupal, if I remember correctly.
Upvotes: 1