hi ricardo,
let's go step by step, if you are changing the database provider, you need to delete all existing migrations and add the migrations for your database provider. see this https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Other-DBMS
see this https://stackoverflow.com/a/42460443/1767482
also application services shouldn't use IFormFile or Stream, use byte[]
for files in your application services.
also see this code, this is used to upload a file which is written in a controller
[RemoteService(Name = FileManagementRemoteServiceConsts.RemoteServiceName)]
[Area("fileManagement")]
[ControllerName("FileDescriptors")]
[Route("api/file-management/file-descriptor")]
[Authorize(FileManagementPermissions.FileDescriptor.Default)]
public class FileDescriptorController : AbpController, IFileDescriptorAppService
{
[HttpPost]
[Route("upload")]
[Authorize(FileManagementPermissions.FileDescriptor.Create)]
[ApiExplorerSettings(IgnoreApi = true)]
public virtual async Task<IActionResult> UploadAsync(Guid? directoryId, IFormFile file)
{
if (file == null)
{
return BadRequest();
}
using (var memoryStream = new MemoryStream())
{
await file.CopyToAsync(memoryStream);
var fileDescriptor = await FileDescriptorAppService.CreateAsync(
new CreateFileInput
{
Name = file.FileName,
MimeType = file.ContentType,
DirectoryId = directoryId,
Content = memoryStream.ToArray()
}
);
return StatusCode(201, fileDescriptor);
}
}
}
maybe this works for you https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Http/CliHttpClient.cs
This is the code that ABP CLI tool authenticates to the abp.io which is made on top of ABP Framework.
not everyone is dealing with raw access to streams. but there's nothing that prevents you to create a new controller and transfer raw streams. by the way I've created an internal issue for this topic. the framework team will make these enhancements.
hi,
there's no direct way to achieve this.
but you can add a new byte
property to your entity, then generate the CRUD page.
afterwards, change the byte
type to byte[]
manually.
(you might need to add a new migration for this change)
alternatively you can use the string
property and save your Image as Base64
format.
Use the following CLI command to download the Lepton source code for both MVC and Angular.
abp get-source Volo.LeptonTheme
Or you can simply download it via ABP Suite
For downloading other source-code parts, see https://support.abp.io/QA/Questions/632/How-can-I-download-the-framework-and-source-code-for-pro-modules#answer-70bbbda7-c0a0-6b02-f782-39f93f11167d
hi
try the following command to download Lepton Theme with Angular source included.
abp get-source Volo.LeptonTheme
See these docs for Angular customization:
@Ryan.sposato@ethany.com disabling transaction is one way.
https://docs.abp.io/en/abp/latest/Unit-Of-Work#default-options
if you want to enable MongoDB transactions, you can do that by installing MongoDB replica set.
docker run --name mongo-0 -p 27018:27017 -d mongo --replSet "rs0" --bind_ip_all
docker run --name mongo-1 -p 27019:27017 -d mongo --replSet "rs0" --bind_ip_all
docker run --name mongo-2 -p 27020:27017 -d mongo --replSet "rs0" --bind_ip_all
docker exec -it [any one container id] mongo admin
rs.initiate({_id:"rs0", members:[{_id:0,host:"your host ip:27018"},{_id:1,host:"your host ip:27019"},{_id:2,host:"your host ip:27020"}]});