media_link_generator 0.0.4 copy "media_link_generator: ^0.0.4" to clipboard
media_link_generator: ^0.0.4 copied to clipboard

Can upload any type of files and get generated link by Media link storage. its totaly free to use. like firebase storage

Media Link Generator #

free to use #

Media link storage

A Flutter package for uploading, managing, and generating secure links for media files. This package provides a Firebase storage alternative for file storage with encryption support.

Features #

  • Upload any type of files and get generated links
  • Firebase alternative for file storage
  • Secure file encryption with secret links
  • Upload progress tracking
  • File deletion capabilities
  • Debug and production mode support
  • Cross-platform compatibility
  • free to use

Documentaion #

API Documentation

For View Uploaded Files #

Screenshots #

Media getter Demo


Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  media_link_generator: ^latest_version

Generate Token one time #

initilized in main function or by others methods #

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:media_link_generator/media_link_generator.dart';

void main() {

      // 1. Generate Directly Token 
      //  var token = await MediaLink().generateAndSetToken(
      //               "yourEmail@gmail.com", shouldPrint: true
      //               );
      // ebugPrint(token.toString()); // 37160f2e00721d906831565829ae1de7
      // MediaLink().setToken(token!);

      // 2. or can get from website and set token
      //// set token 
      MediaLink().setToken("37160f2e00721d906831565829ae1de7");

      runApp(MaterialApp(home: HomePage()));
}

for upload simple files #

           /////// 2 . Generate Link
          Text("Upload Media Files For Generate Link"),
          ElevatedButton(
            onPressed: () async {
              var getLink = await MediaLink().uploadSimpleFile(
                        File("filePath"),
                        folderName: "items",
                        isSecret: false, // fully secured file only can see by generated link and file can not be opend without this generate link
                        fromDeviceName: "iphone 16 pro",
                        shouldPrint: true,
                        onUploadProgress: (uploadingPercentage) {
                          debugPrint(uploadingPercentage.toString());
                        },
                  );

              debugPrint(getLink!.toJson().toString());
              // https://filelink.com/link/v.php?t=1759519999&tk=37160f2e00721d906831565829ae1de7"
            },
            child: Text("Upload File with encyption"),
          ),

Upload File In Bytes #

          /////// 3 . Upload File Bytes & Generate Link
          Text("Upload File Bytes For Generate Link"),
          ElevatedButton(
            onPressed: () async {
              var getLink = await MediaLink().uploadFileInBytes(
                await File("filePath").readAsBytes(),
                folderName: "items",
                isSecret:
                    false, // fully secured file only can see by generated link and file can not be opend without this generate link
                fromDeviceName: "iphone 16 pro",
                shouldPrint: true,
                onUploadProgress: (uploadingPercentage) {
                  debugPrint(uploadingPercentage.toString());
                },
              );

              debugPrint(getLink.toJson().toString());
            },
            child: Text("Upload File with encyption"),
          ),


for delete #

            /////////// 4. Delete Token 
            ElevatedButton(
            onPressed: () async {
                var result = await MediaLink().deleteFile(
                        "https://filelink.com/link/v.php?t=1759519999&tk=37160f2e00721d906831565829ae1de7", shouldPrint: true
                    );
                if(result){
                    debugPrint("Deleted");
                    }else{
                    debugPrint("Not Deleted");
                }
              },
              child: Text("Delete File"),
            ),
1
likes
150
points
15
downloads
screenshot

Publisher

unverified uploader

Weekly Downloads

Can upload any type of files and get generated link by Media link storage. its totaly free to use. like firebase storage

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

dio, flutter

More

Packages that depend on media_link_generator