Upload files into project using Heroku app - spring

I faced one problem while uploading files to the server Heroku app. My spring boot app provide ability to parse Excel file with many records. Inside my application I download file by path and using my methods I parse my file to store records inside database. Locally everything works fine, but when I try to upload my Excel file and get an 403 error. As I correctly understand this error occurs because I didn't allow Heroku service to upload files(my Heroku server doesn't have a permission). So how can I give that permission to solve my problem, or maybe there is another way to solve. Thank you for your answers.

Related

Strapi deployed to Heroku but media files give 404 error

I've deployed Strapi on Heroku and have set up the content fine. When I uploaded images and videos to Strapi using the cms interface and saved the update. it saved successfully but the file url returns 404. has anyone experienced this before? Am I missing something?
Thanks guys.
https://strapi.io/documentation/3.0.0-beta.x/guides/deployment.html#file-uploads
File Uploads
Like with project updates on Heroku, the file system doesn't support local uploading of files as they will be wiped when Heroku "Cycles" the dyno. This type of file system is called ephemeral, which means the file system only lasts until the dyno is restarted (with Heroku this happens any time you redeploy or during their regular restart which can happen every few hours or every day).
Due to Heroku's filesystem you will need to use an upload provider such as AWS S3, Cloudinary, or Rackspace. You can view the documentation for installing providers here and you can see a list of providers from both Strapi and the community on npmjs.com.

Laravel deployment and update on Apache Webserver

I want to get my Larvel project ready for deployment.
I already found some guides in the web, but no one of them could answer me the following question(s):
Which file do I have to upload to the webserver?
I already tried to remove as much folders/files as possible to keep the project-size on my apache webserver as small as possible. But is there any guide which tells me, which folders/files do i exactly need to exchange?
When it comes to an update:
Once deployed, which files do i need to update?
Do I have to upload all the files again or can I exchange only certain ones?
Currently i followed the official laravel guide and uploaded all files to the webserver.

Parse- Server Transferring files hosted on Heroku to AWS S3 bucket

I have parse-server running on Heroku. When I first created this app, I didn't specify a files adapter in index.js, so all uploaded files have been getting stored on Heroku.
So I have now run out of room and I have set up an AWS S3 bucket to store my files on. This is working fine expect for the fact that any files which were originally stored on Heroku can no longer be accessed through the application.
At the moment I am thinking about looping through all objects which have a relation to a file stored on heroku, then uploading that file to S3 bucket. Just hoping that there may be some tool out there or that someone has an easier process for doing this.
thanks
There are migration guides for migrating parse server itself but I don't see anything in the documentation for migrating hosted files unfortunately.
I did find one migration tool but it appears to still utilize the previous file adapter (on your heroku instance) and then stores anything new on the new adapter (s3 storage).
parse-server-migrating-adapter

Phoenix file copying on Heroku

I'm trying to upload images to my Phoenix app on Heroku. I have a simple app that follows the instructions for file uploading from Phoenix's docs.
I have a simple form and the controller uses File.cp_r() to copy the file from the temp directory.
def create(conn, %{"user" => user_params}) do
if upload = user_params["photo"] do
File.cp_r(upload.path, "priv/static/images/foo.jpg") #non-dynamic name, doens't matter
end
...
end
Works just file on my local. However when I upload this to Heroku, test the form and heroku run find on the directory, I don't see anything.
I have noticed that this directory on heroku has a seemingly forbidding privilege:
drwx------ 2 u25619 dyno 4096 Apr 23 05:14 images
I tried slipping in a nice little File.chmod("priv/static/images", 0o777), but to no avail; that directory seems locked away from me, so I think this is a heroku issue.
Any idea how to handle this?
EDIT: Resolved by using the phoenix dep ex_aws to upload to an Amazon S3 bucket.
ex_aws dependency
partial explanation (note: you need to add poison and hackney to make this work, they are not mentioned)
The file system on heroku is ephemeral, and you won't have access to any files that you save on it across deploys or when you start new instances.
Also, when you run heroku run, you're not connecting up to that same instance that's currently running your app, instead what it'll do is to launch a new instance so those uploaded files would not exist there.
A better approach is to save the uploaded files to S3 or similar where you can still access it across deploys.

I need Parse Android App migration for cloud code and push but not able to understand where to start for cloud code?

I completed local parse server and mongodb installation and app is connected through db and working now, but push and cloud code is not working. I do not have any idea where to put the main.js file in my mac. not getting the cloud folder.
please can somebody guide me .
You will have to manually create the folder you want to put your Cloud Code in. The easy way is to crate one in your project's root folder and then update the config you pass to Parse Server to point to that directory.
You can find a basic example with a config that includes the Cloud Code folder in the README of the Parse Server GitHub repo as well.

Resources