Starts in:
2 DAYS
3 HRS
57 MIN
33 SEC
Starts in:
2 D
3 H
57 M
33 S

Activities of "dean_ve"

Thanks, that helps a lot.

Question
  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

I am using the FileManagement module to store files in Aws S3 using the AwsBlobProvider.

We need to set the correct Content Type (Mime Type) on Aws when the files are stored. The correct content type is stored in the local DB and looking at the code there is a MimeType property on the FileDescriptor object passed to the IFileDescriptorRepository.InsertAsync() method. I've created my own AwsBlobProvider that can accept ContentType but how do I intercept the IFileDescriptorRepository.InsertAsync() to insert the MimeType?

Thanks, Dean

Thanks, I got it working on both the file system and AWS.

I was assuming that there would be no entry in the application database and the file would be just written to the new blob storage. I see that abp writes an entry to the FmFileDescriptors table and puts the actual file data in the configured blob probider.

Also noted that the configuration code only needs to go in the Domain module.

I really appreciate your help.

Dean

Hi,

Removing typeof(BlobStoringDatabaseDomainModule) and Volo.Abp.BlobStoring.Database.* package from the Domain module had no effect excpet that an exception was thrown when the Download command is used in the Balzor UI.

Do you have an example of the File Management module using a blob storing provider different from the default database provider? (eg File System, Aws or Azure)

Dean

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v4.2.1
  • UI type: Blazor
  • DB provider: EF Core (SQL Server)
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: N/A
  • Steps to reproduce the issue:

I'm trying to get the FIleManagement module to use the AWS Blob provider but it always seems to use the Database provider. This is what I've done.

  1. Created a fresh new ABP 4.2.1 Blazor UI project.
  2. Added the FileManagement Module.
  3. Built solution and was able to add/delete files via the Blazor UI.
  4. Followed the instructions for setting the Blob provider and the AWS Provider.

The FileManagement module still uses the Database provider. I've tried putting the AWS configuration code in the Domain, Application & EntityFramework and HttpApi modules but none seems to work.

Below is the code I have been trying (AWS credentials not shown) from the Domain module.

Thank's in advance for your help!

Dean

<br>

namespace FMTest
{
    [DependsOn(
        typeof(FMTestDomainSharedModule),
        typeof(AbpAuditLoggingDomainModule),
        typeof(AbpBackgroundJobsDomainModule),
        typeof(AbpFeatureManagementDomainModule),
        typeof(AbpIdentityDomainModule),
        typeof(AbpPermissionManagementDomainIdentityModule),
        typeof(AbpIdentityServerDomainModule),
        typeof(AbpPermissionManagementDomainIdentityServerModule),
        typeof(AbpSettingManagementDomainModule),
        typeof(SaasDomainModule),
        typeof(TextTemplateManagementDomainModule),
        typeof(LeptonThemeManagementDomainModule),
        typeof(LanguageManagementDomainModule),
        typeof(VoloAbpCommercialSuiteTemplatesModule),
        typeof(AbpEmailingModule),
        typeof(BlobStoringDatabaseDomainModule)
        )]
    [DependsOn(typeof(FileManagementDomainModule))]
    [DependsOn(typeof(AbpBlobStoringAwsModule))]
    public class FMTestDomainModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            Configure<AbpMultiTenancyOptions>(options =>
            {
                options.IsEnabled = MultiTenancyConsts.IsEnabled;
            });

            Configure<AbpLocalizationOptions>(options =>
            {
                options.Languages.Add(new LanguageInfo("en", "en", "English", "gb"));
                options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe", "tr"));
                options.Languages.Add(new LanguageInfo("sl", "sl", "Slovenščina", "si"));
                options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文", "cn"));
                options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsche", "de"));
                options.Languages.Add(new LanguageInfo("es", "es", "Español", "es"));
            });

            ConfigureAWSBlobStoring();

#if DEBUG
            context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
#endif
        }

        private void ConfigureAWSBlobStoring()
        {
            Configure<AbpBlobStoringOptions>(options =>
            {
                options.Containers.Configure<FileManagementContainer>(container =>
                {
                    container.UseAws(Aws =>
                    {
                        Aws.AccessKeyId = "your Aws access key id";
                        Aws.SecretAccessKey = "your Aws access key secret";
                        Aws.UseCredentials = false;//"set true to use credentials";
                        Aws.UseTemporaryCredentials = false;// "set true to use temporary credentials";
                        Aws.UseTemporaryFederatedCredentials = false;// "set true to use temporary federated credentials";
                        Aws.ProfileName = "the name of the profile to get credentials from";
                        Aws.ProfilesLocation = "the path to the aws credentials file to look at";
                        Aws.Region = "the system name of the service";
                        Aws.Name = "the name of the federated user";
                        Aws.Policy = "policy";
                        Aws.DurationSeconds = 100000;// "expiration date";
                        Aws.ContainerName = "your Aws container name";
                        Aws.CreateContainerIfNotExists = false;
                    });
                });
            });
        }
    }
}
Showing 1 to 5 of 5 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06