{"id":351,"date":"2023-05-07T22:56:21","date_gmt":"2023-05-07T20:56:21","guid":{"rendered":"https:\/\/pierre.porcheret.org\/?p=351"},"modified":"2023-08-21T15:41:02","modified_gmt":"2023-08-21T13:41:02","slug":"transfert-python-flask","status":"publish","type":"post","link":"https:\/\/pierre.porcheret.org\/en\/computer\/python\/351\/","title":{"rendered":"Transfert"},"content":{"rendered":"<h2 class=\"wp-block-heading\">About<\/h2>\n\n\n\n<p>Some days ago, I had to transfer a big file. Of course, you can&rsquo;t use your mail service to send big files, and you have to use a dedicated tool. As I don&rsquo;t want to use sensitive or personal files on cloud, I avoid to use website such as WeTransfert or Web alternative, and I don&rsquo;t want to create account for a single use in these websites. <\/p>\n\n\n\n<p>I used to upload in a self-hosted tool, Jirafeau (<a href=\"https:\/\/gitlab.com\/mojo42\/Jirafeau\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/gitlab.com\/mojo42\/Jirafeau<\/a>). This tool works nicely  but I find it not really adapt to my vision. So&#8230; I decided to develop mine..<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">My needs<\/h2>\n\n\n\n<p>I wanted something:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Simple and modern <\/li>\n\n\n\n<li>QRcode (to transfert to my phone)<\/li>\n\n\n\n<li>No database <\/li>\n\n\n\n<li>Manage expired or Single download files<\/li>\n\n\n\n<li>Using SSL for transfert.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen1-1024x471.png\" alt=\"\" class=\"wp-image-356\" srcset=\"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen1-1024x471.png 1024w, https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen1-300x138.png 300w, https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen1-768x353.png 768w, https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen1-18x8.png 18w, https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen1.png 1193w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><em>List of files and informations<\/em>.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>I turn again to python and Flask to develop something (as for my tool <a href=\"https:\/\/pierre.porcheret.org\/en\/computer\/316\/\">Hype<\/a> ).<\/p>\n\n\n\n<p>Flask is a very nice framework and provide a lot of tools to my need; You can easily add a certificate (autosigned), you can force a file for downloading, automate actions&#8230; And many plugins will complete my code (QRcode, Drag and Drop&#8230;)<\/p>\n\n\n\n<p>My first reaction when I start this project was \u00ab\u00a0Ok it will be fast to do, it&rsquo;s easy as I already use a Dropzone and I know how to force a download\u00a0\u00bb. Then I start to work on it. I start to think about all the steps I have to do and all info I will need ; As I don&rsquo;t want to implement a database, where to store info ? How to retrieve and what info I will need (to check retention, single download&#8230;)? How to manipulate date and time easily ?<\/p>\n\n\n\n<p>I stopped&#8230; It was not as simple..<\/p>\n\n\n\n<p>Then I start again, but this time, as all development should start : an <strong>algorithm<\/strong>.<\/p>\n\n\n\n<p>Once the algorithm done, everything came easily, and I just add to organize and convert my algorithm to code.<\/p>\n\n\n\n<p>I let you discover my code here and feel free if you see amelioration or bugs :<\/p>\n\n\n\n<p><a href=\"https:\/\/git.nerkdesign.com\/pporcheret\/Transfert\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/git.nerkdesign.com\/pporcheret\/Transfert<\/a><\/p>\n\n\n<div class=\"wp-block-image is-style-rounded\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"701\" height=\"600\" src=\"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen2.png\" alt=\"\" class=\"wp-image-355\" srcset=\"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen2.png 701w, https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen2-300x257.png 300w, https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/screen2-14x12.png 14w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><figcaption class=\"wp-element-caption\"><em>Download page to share with the client.<\/em><\/figcaption><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>To tranfert big files and keep data in my own, I decided to create my own tool in python and Flask.<\/p>","protected":false},"author":1,"featured_media":353,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"two_page_speed":null,"footnotes":""},"categories":[8,9,40],"tags":[32,31,47],"class_list":["post-351","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer","category-linux","category-python","tag-flask","tag-python","tag-transfert"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Transfert -<\/title>\n<meta name=\"description\" content=\"To tranfert big files and keep data in my own, I decided to create my own tool in python and Flask.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pierre.porcheret.org\/en\/computer\/python\/351\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Transfert -\" \/>\n<meta property=\"og:description\" content=\"To tranfert big files and keep data in my own, I decided to create my own tool in python and Flask.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pierre.porcheret.org\/en\/computer\/python\/351\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-07T20:56:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-21T13:41:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/pexels-karolina-grabowska-4219862-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1707\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"pporcheret\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pporcheret\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/\"},\"author\":{\"name\":\"pporcheret\",\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/#\\\/schema\\\/person\\\/7cf1070cb05adff1e5b95c7ca9b0dd52\"},\"headline\":\"Transfert\",\"datePublished\":\"2023-05-07T20:56:21+00:00\",\"dateModified\":\"2023-08-21T13:41:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/\"},\"wordCount\":355,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/pierre.porcheret.org\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/pexels-karolina-grabowska-4219862-scaled.jpg\",\"keywords\":[\"Flask\",\"Python\",\"Transfert\"],\"articleSection\":[\"Computer\",\"Linux\",\"Python\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/\",\"url\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/\",\"name\":\"Transfert -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/pierre.porcheret.org\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/pexels-karolina-grabowska-4219862-scaled.jpg\",\"datePublished\":\"2023-05-07T20:56:21+00:00\",\"dateModified\":\"2023-08-21T13:41:02+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/#\\\/schema\\\/person\\\/7cf1070cb05adff1e5b95c7ca9b0dd52\"},\"description\":\"To tranfert big files and keep data in my own, I decided to create my own tool in python and Flask.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/#primaryimage\",\"url\":\"https:\\\/\\\/pierre.porcheret.org\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/pexels-karolina-grabowska-4219862-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/pierre.porcheret.org\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/pexels-karolina-grabowska-4219862-scaled.jpg\",\"width\":2560,\"height\":1707},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/computer\\\/python\\\/351\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/pierre.porcheret.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Transfert\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/#website\",\"url\":\"https:\\\/\\\/pierre.porcheret.org\\\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pierre.porcheret.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pierre.porcheret.org\\\/#\\\/schema\\\/person\\\/7cf1070cb05adff1e5b95c7ca9b0dd52\",\"name\":\"pporcheret\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/04949048b44501d434ac6a78cb6790e936aef0a9dce8f0cfcfd1cd9926f1ffb7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/04949048b44501d434ac6a78cb6790e936aef0a9dce8f0cfcfd1cd9926f1ffb7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/04949048b44501d434ac6a78cb6790e936aef0a9dce8f0cfcfd1cd9926f1ffb7?s=96&d=mm&r=g\",\"caption\":\"pporcheret\"},\"sameAs\":[\"https:\\\/\\\/pierre2.porcheret.org\"],\"url\":\"https:\\\/\\\/pierre.porcheret.org\\\/en\\\/author\\\/pporcheret\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Transfert -","description":"To tranfert big files and keep data in my own, I decided to create my own tool in python and Flask.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/pierre.porcheret.org\/en\/computer\/python\/351\/","og_locale":"en_GB","og_type":"article","og_title":"Transfert -","og_description":"To tranfert big files and keep data in my own, I decided to create my own tool in python and Flask.","og_url":"https:\/\/pierre.porcheret.org\/en\/computer\/python\/351\/","article_published_time":"2023-05-07T20:56:21+00:00","article_modified_time":"2023-08-21T13:41:02+00:00","og_image":[{"width":2560,"height":1707,"url":"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/pexels-karolina-grabowska-4219862-scaled.jpg","type":"image\/jpeg"}],"author":"pporcheret","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pporcheret","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/#article","isPartOf":{"@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/"},"author":{"name":"pporcheret","@id":"https:\/\/pierre.porcheret.org\/#\/schema\/person\/7cf1070cb05adff1e5b95c7ca9b0dd52"},"headline":"Transfert","datePublished":"2023-05-07T20:56:21+00:00","dateModified":"2023-08-21T13:41:02+00:00","mainEntityOfPage":{"@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/"},"wordCount":355,"commentCount":0,"image":{"@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/#primaryimage"},"thumbnailUrl":"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/pexels-karolina-grabowska-4219862-scaled.jpg","keywords":["Flask","Python","Transfert"],"articleSection":["Computer","Linux","Python"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pierre.porcheret.org\/computer\/python\/351\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/","url":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/","name":"Transfert -","isPartOf":{"@id":"https:\/\/pierre.porcheret.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/#primaryimage"},"image":{"@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/#primaryimage"},"thumbnailUrl":"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/pexels-karolina-grabowska-4219862-scaled.jpg","datePublished":"2023-05-07T20:56:21+00:00","dateModified":"2023-08-21T13:41:02+00:00","author":{"@id":"https:\/\/pierre.porcheret.org\/#\/schema\/person\/7cf1070cb05adff1e5b95c7ca9b0dd52"},"description":"To tranfert big files and keep data in my own, I decided to create my own tool in python and Flask.","breadcrumb":{"@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pierre.porcheret.org\/computer\/python\/351\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/#primaryimage","url":"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/pexels-karolina-grabowska-4219862-scaled.jpg","contentUrl":"https:\/\/pierre.porcheret.org\/wp-content\/uploads\/2023\/05\/pexels-karolina-grabowska-4219862-scaled.jpg","width":2560,"height":1707},{"@type":"BreadcrumbList","@id":"https:\/\/pierre.porcheret.org\/computer\/python\/351\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/pierre.porcheret.org\/"},{"@type":"ListItem","position":2,"name":"Transfert"}]},{"@type":"WebSite","@id":"https:\/\/pierre.porcheret.org\/#website","url":"https:\/\/pierre.porcheret.org\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pierre.porcheret.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/pierre.porcheret.org\/#\/schema\/person\/7cf1070cb05adff1e5b95c7ca9b0dd52","name":"pporcheret","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/04949048b44501d434ac6a78cb6790e936aef0a9dce8f0cfcfd1cd9926f1ffb7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/04949048b44501d434ac6a78cb6790e936aef0a9dce8f0cfcfd1cd9926f1ffb7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/04949048b44501d434ac6a78cb6790e936aef0a9dce8f0cfcfd1cd9926f1ffb7?s=96&d=mm&r=g","caption":"pporcheret"},"sameAs":["https:\/\/pierre2.porcheret.org"],"url":"https:\/\/pierre.porcheret.org\/en\/author\/pporcheret\/"}]}},"_links":{"self":[{"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":5,"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"predecessor-version":[{"id":377,"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/posts\/351\/revisions\/377"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/media\/353"}],"wp:attachment":[{"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pierre.porcheret.org\/en\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}