Updating nextcloud dependency, fixing upload and pub dep error
This commit is contained in:
@ -1,30 +0,0 @@
|
||||
import 'dart:io';
|
||||
import 'package:nextcloud/nextcloud.dart';
|
||||
|
||||
// NOT WORKING curl -H 'Transfer-Encoding: chunked' -H 'Content-Type: image/png' --compressed -u goldbaja -T /home/elias/Bilder/robotikmeme.png https://cloud.marianum-fulda.de/remote.php/webdav/some-image.png
|
||||
// WORKS curl -H 'Transfer-Encoding: chunked' -H 'Content-Type: image/png' --compressed -u minetec -T /home/elias/Bilder/robotikmeme.png https://mhsl.eu/cloud/remote.php/webdav/some-image.png
|
||||
|
||||
void main() async {
|
||||
print("HELLO WORLD");
|
||||
WebDavClient client = NextcloudClient("https://cloud.marianum-fulda.de", username: "xxx", password: "xxx", loginName: "xxx").webdav;
|
||||
|
||||
final fileBytes = File("/home/elias/Bilder/robotikmeme.png").readAsBytesSync();
|
||||
|
||||
print(fileBytes.length);
|
||||
|
||||
HttpClientResponse response = await client.upload(fileBytes, "menue/test.png");
|
||||
print(response.statusCode);
|
||||
|
||||
await Future.delayed(const Duration(seconds: 5)); // Wait a bit, just in case
|
||||
|
||||
final responses = (await client.ls(
|
||||
'/menue/',
|
||||
prop: WebDavPropfindProp.fromBools(
|
||||
ocsize: true,
|
||||
),
|
||||
)).responses;
|
||||
|
||||
print("Filesize local: ${fileBytes.length}");
|
||||
print("Filesize on Server: ${responses.singleWhere((final response) => response.href!.endsWith('/menue/test.png')).propstats.first.prop.ocsize}");
|
||||
|
||||
}
|
Reference in New Issue
Block a user