Excel الى CS
هذا REST API saveas
ملف Excel إلى CSV.
POST / الخلايا / {name} / saveAs يتيح لك API حفظ ملف MS Excel كملف CSV بإعدادات إضافية وحفظ النتيجة في وحدة التخزين.
هذا REST API convert
ملف Excel إلى CSV.
وضع / خلايا / تحويل يتيح لك API تحويل ملف MS Excel إلى ملف CSV بإعدادات إضافية وحفظ النتيجة في الاستجابة.
هذا REST API export
ملف Excel إلى CSV.
الحصول على / الخلايا / {name} يتيح لك API تحويل ملف MS Excel إلى ملف CSV بإعدادات إضافية وحفظ النتيجة في الاستجابة.
REST API
API
يكتب
وصف
رابط التباهي
/ خلايا / تحويل
يضع
يحول المصنف من طلب المحتوى إلى تنسيق ما
PutConvertWorkBook
/ خلايا / {name}
يحصل
يصدر المصنف إلى تنسيق آخر.
GetWorkBook
/ الخلايا / {name} / saveAs
بريد
تصدير المصنف إلى تنسيق
PostDocumentSaveAs
تحدد واجهات برمجة التطبيقات هذه واجهة برمجة يمكن الوصول إليها بشكل عام وتتيح لك إجراء تفاعلات REST مباشرة من مستعرض ويب.
يمكنك استخدامcURL أداة سطر الأوامر للوصول إلى خدمات الويب Aspose.Cells بسهولة. يوضح المثال التالي كيفية إجراء مكالمات إلى Cloud API مع cURL.
عائلة Cloud SDK
يعد استخدام SDK أفضل طريقة لتسريع عملية التطوير. يعتني SDK بالتفاصيل منخفضة المستوى ويتيح لك التركيز على مهام مشروعك. يرجى التحقق منمستودع جيثب للحصول على قائمة كاملة من Aspose.Cells Cloud SDKs.
توضح أمثلة التعليمات البرمجية التالية كيفية إجراء مكالمات إلى خدمات الويب Aspose.Cells باستخدام حزم SDK متنوعة:
C#
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/
Aspose . Cells . Cloud . SDK . Api . CellsApi cellsApi = new CellsApi ( "your client id" , "your client secret" );
var response = cellsApi . CellsWorkbookPutConvertWorkbook ( File . OpenRead ( @".\TestData\datasource.xlsx" ), "csv" , null , null );
Assert . IsInstanceOf < System . IO . Stream >( response , "response is System.IO.Stream" );
Java
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-java/
try {
LightCellsApi liteApi = new LightCellsApi ( System . getenv ( "CellsCloudTestClientId" ), System . getenv ( "CellsCloudTestClientSecret" ));
String AssemblyTestXlsx = "assemblytest.xlsx" ;
String DataSourceXlsx = "datasource.xlsx" ;
HashMap < String , File > fileMap = new HashMap < String , File >();
fileMap . put ( AssemblyTestXlsx , new File ( "TestData\\" + AssemblyTestXlsx ));
fileMap . put ( DataSourceXlsx , new File ( "TestData\\" + DataSourceXlsx ) );
FilesResult response = liteApi . postExport ( fileMap , "workbook" , "csv" );
} catch ( ApiException e ) {
e . printStackTrace ();
}
//2. solution
try {
CellsApi api = new CellsApi ( System . getenv ( "CellsCloudTestClientId" ), System . getenv ( "CellsCloudTestClientSecret" ));
File response = api . cellsWorkbookPutConvertWorkbook (
new File ( "TestData\\Book1.xlsx" ), "csv" , null , null );
} catch ( ApiException e ) {
e . printStackTrace ();
}
Go
LightCellsAPI := NewLightCellsApiService ( clientId , clientSecret )
var fileMap map [ string ] string
fileMap = make ( map [ string ] string )
fileMap [ "Book1.xlsx" ] = "TestData\\Book1.xlsx"
fileMap [ "Book2.xlsx" ] = "TestData\\Book2.xlsx"
postOpts := new ( PostExportOpts )
postOpts . Format = "csv"
postOpts . ObjectType = "workbook"
_ , httpResponse , err := LightCellsAPI . PostExport ( fileMap , postOpts )
if err != nil {
t . Error ( err )
} else if httpResponse . StatusCode < 200 || httpResponse . StatusCode > 299 {
t . Fail ()
} else {
fmt . Printf ( "\tTestCellsPostExport \n" )
}
CellsAPI := NewCellsApiService ( clientId , clientSecret )
args := new ( CellsWorkbookPutConvertWorkbookOpts )
args . Format = "csv"
file , err := os . Open ( "TestData\\Book1.xlsx" )
if err != nil {
return
}
localVarReturnValue , httpResponse , err := CellsAPI . CellsWorkbookPutConvertWorkbook ( file , args )
if err != nil {
t . Error ( err )
} else if httpResponse . StatusCode < 200 || httpResponse . StatusCode > 299 {
t . Fail ()
} else {
fmt . Printf ( "\t TestCellsPutConvertWorkbook - %d\n" , httpResponse . StatusCode )
}