File Upload Handling with Pynecone - python

I want to create a file sharing website in with pynecone. Is there a go-to way to upload files and save them on the server?
The documentation says to use React components if there aren't any Pynecone specific components, but I wanted to know if Pynecone can handle files uploads on its own.

This is not available yet, but is a high priority feature to add. There is an open ticket here. It should be available soon.

Related

Is there a way to create .msg files for Outlook on a Linux based system?

So my current situation is like that. I got a website running using flask. Based on user input I want to create a already prepared .msg file for Outlook. The part of transmitting user input to flask is already working, so now i only need to create the .msg file. I just can't figure out the way on how to do it. Preferably it should be able to be run on a linux based system.
You can easily create an EML (MIME) file - Outlook will be happy to show it to the user just like an MSG file. If you want the message to be unsent, don't forget to set the X-Unsent MIME header.
You can create .msg files as long as you have some form of outlook app at your disposal. Because .msg is a propriatery format, the chance of you creating one without some MS tool (like outlook) is very unlikely. If you have outlook, you can download your emails in that format and then use them in your app.
There are plenty of .msg readers and converters to .eml, but sadly nothing Linux based as far as I know.
The .msg file is described in depth. So, you are free to compose them on your own. See Outlook Item (.msg) File Format for more information.
I have found an open-source library which can be used in C# for generating .msg files - MsgKit. And I think you can find a similar assembly that can be used in your programming language too.
Finally, you can find third-party libraries for generating .msg file programmatically, see Aspose.

Managing server files in django

I see various bits of information in the docs, but I can't seem to form the complete picture.
I wish to hold various text, audio and video files on the server. At the moment I'm not planning to add user upload support but it would be nice to expand to that in the future.
I just don't understand where to start and what to do. Where do I save those files on the server? What is the best way for django to interact with those files?
I hope that you can help me with the confusion :)

How to serve previously uploaded video files in Django

I'm developing a Django site which allows users to upload PDF, image and video files. Django is able to serve the pdf and image files comfortably for my purposes but cannot cope with the video downloads. Is there a way to load video files via Django but them serve them using a different server?
Is there a way to load video files via Django but them serve them
using a different server?
You should define what you mean by "different server". but I assume, you mean different project that is not written in Django.
Since video files land in file system ( if you design so), you can access them as you want if different project is running on the same server. otherwise you would need some file sync between servers. if you want to distinguish which video file belongs to which object in db, I would insert the object name into filepath.
if I didnot fully answer your question, let me know below

user upload to my S3 bucket

I would like for a user, without having to have an Amazon account, to be able to upload mutli-gigabyte files to an S3 bucket of mine.
How can I go about this? I want to enable a user to do this by giving them a key or perhaps through an upload form rather than making a bucket world-writeable obviously.
I'd prefer to use Python on my serverside, but the idea is that a user would need nothing more than their web browser or perhaps opening up their terminal and using built-in executables.
Any thoughts?
You are attempting to proxy the file thorough your python backend to S3, that too large files. Instead you can configure S3 to accept files from user directly (without proxying through your backend code).
It is explained here: Browser Uploads to S3 using HTML POST Forms. This way your server need not handle any upload load at all.
If you also want your users to use their elsewhere ID (google/FB etc) to achieve this workflow, that too is possible. They will be able to upload these files to a sub-folder (path) in your bucket without exposing other parts of your bucket. This is detailed here: Web Identity Federation with Mobile Applications. Though it says mobile, you can apply the same to webapps.
Having said all that, as #Ratan points out, large file uploads could break in between when you try from a browser and it cant retry "only the failed parts". This is where a dedicated app's need come in. Another option is to ask your users to keep the files in their Dropbox/BOX.com account and your server can read from there - these services already take care of large file upload with all retries etc using their apps.
This answer is relevant to .Net as language.
We had such requirement, where we had created an executable. The executable internally called a web method, which validated the app authenticated to upload files to AWS S3 or NOT.
You can do this using a web browser too, but I would not suggest this, if you are targeting big files.

How do you create a video file upload form with Django?

I want a user to be able to upload a video from their computer or record it right from their webcam, then fill out other information with a form. I'm writing this app with Django.
Recording directly from the web cam is not as simple as uploading an existing video file. You may need to look into one of the many video streaming protocols and handle that via a server such as red5. This approach would require the use of Flash or something similar.
The Django documentation should be able to help you handle file uploads:
http://docs.djangoproject.com/en/dev/topics/http/file-uploads/
Additionaly have a look at jquery uploadify. It's pretty useful for large file uploads because it display the progress of the download.

Categories

Resources