This topic is locked

How to upload files to individual user's folder on Amazon S3

5/5/2022 4:19:07 PM
General Tips and Tricks
Admin

This article applies to file upload to S3 (Amazon AWS) cloud storage. For instance, we have a session variable named "user_id" that stores user ids like 7354322. We want to store each user's files in their own folder like userfiles/7354322.

To achieve this we can add the following code to After Table Init event

PHPRunner:

$tables_data[$table]["fieldname"]["S3Path"] = "userfiles/".$_SESSION["user_id"];

ASPRunner.NET:

GlobalVars.tables_data[table]["fieldname"]["S3Path"] = "userfiles/" + XSession.Session["user_id"].ToString();

Just make sure to repolace fieldname with the actual name of the field where you stire uploaded files info.