Is Aspose.BarCode supported to work in a Microsoft Azure web app resource?
Here is the code I you requested:
public class FileManager
{
private string _barCodeFolderPath = "/Content/images/BarCodes/";
public string BarCodeFolderPath
{
get { return _barCodeFolderPath; }
}
public string CreateBarCode(string barcodeString, int coversheetId)
{
string barcodeSavePath = HttpContext.Current.Server.MapPath("~" + this._barCodeFolderPath + coversheetId.ToString() + ".gif");
BarCodeBuilder barcodeBuilder = new BarCodeBuilder();
barcodeBuilder.CodeText = barcodeString;
barcodeBuilder.EncodeType = Aspose.BarCode.Generation.EncodeTypes.Code128;
barcodeBuilder.xDimension = 1f;
barcodeBuilder.Save(barcodeSavePath, System.Drawing.Imaging.ImageFormat.Gif);
return _barCodeFolderPath + coversheetId + ".gif";
}
}
According to a different post, you guys said,
"We just found out that the exception occurred due to security restrictions. The IUSR_MachineName should have write access on the directory where you want to save the image files."
the question is how do I do that in an Azure Environment.
if it cannot be done in Azure, then the only other solution I can think of is:
Does ASP.Barcode have an other way of Render a Barcode images without having to write a image file to the server.
{
string barcodeSavePath = HttpContext.Current.Server.MapPath("~" + this._barCodeFolderPath + coversheetId.ToString() + ".gif");
using( BarCodeBuilder barcodeBuilder = new BarCodeBuilder())
{
barcodeBuilder.CodeText = barcodeString;
barcodeBuilder.EncodeType = Aspose.BarCode.Generation.EncodeTypes.Code128;
barcodeBuilder.xDimension = 1f;
barcodeBuilder.Save(barcodeSavePath, System.Drawing.Imaging.ImageFormat.Gif);
}
return _barCodeFolderPath + coversheetId + ".gif";
}