file-storage

Pro & Cons of storing files(pictures) in a SQL Server for a website

无人久伴 提交于 2019-12-02 03:58:20
I'm creating an Asp.Net MVC website. I've in the past, for heavy application, multiple layer application, used the database to store files. But now I'm questioning myself, is this a good idea for a website? In a performance view? It has several pros to me: Allows me to control easily if the connected user has the right to display the image(Required for my project) Permits to be sure that we have consistent data(otherwise we can have an existing file but no info in the database and the opposite I need a fail-over webserver, and those files will be imported from a third server, so if those files

Storing big file pdf,xlsx into indexedDB and downloading from there

风格不统一 提交于 2019-12-01 14:58:02
I was trying to save a file into indexed db and download the same from indexed db once the system is offline. Am facing with two issue. The file which i pushed to db after downloading am not able to open the file. When large file such like anything more than 150 MB its breadking giving error in JSON.stringify() Putting my code below. Please help me am in desperate to finish this. is there anything am doing wrong any other better approach or even any leads to get it correct will be relay helpful downloadfile() { var self = this; var getComment = 'http://localhost/PWAS/CommentService/api

JavaScript: Writing to download stream

跟風遠走 提交于 2019-11-30 05:13:52
问题 I want to download an encrypted file from my server, decrypt it and save it locally. I want to decrypt the file and write it locally as it is being downloaded rather than waiting for the download to finish, decrypting it and then putting the decrypted file in an anchor tag. The main reason I want to do this is so that with large files the browser does not have to store hundreds of megabytes or several gigabytes in memory. 回答1: This is only going to be possible with a combination of service

Heroku File Storage

落花浮王杯 提交于 2019-11-29 22:09:18
Heroku only has 100MB of file storage, right? I'm making a low-level rails app and I really like Heroku, but if my app allows each user to upload one picture, I may run out of space quickly...is there a simple solution that will allow me to have alternative file storage for profile pics or something of the like? thenengah See this blog post In your model. has_attached_file :picture, :styles => {:large => "275x450>"}, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => "appname/:attachment/:style/:id.:extension" In s3.yml in your config dir: development: bucket:

What is the best Environment.SpecialFolder for store application data in Xamarin.Forms?

人走茶凉 提交于 2019-11-29 07:33:27
问题 I'm new in Xamarin.Forms and mobile development. I want to store user and encrypted password of my application user in file on mobile device. I'm using xamarin forms technology. I kwnow that there are many differenet folders. In example: System.Environment.SpecialFolder.Personal System.Environment.SpecialFolder.LocalApplicationData System.Environment.SpecialFolder.MyDocuments Full list you can find here: https://msdn.microsoft.com/en-gb/en-enl/library/system.environment.specialfolder(v=vs.110

Heroku File Storage

两盒软妹~` 提交于 2019-11-28 18:30:44
问题 Heroku only has 100MB of file storage, right? I'm making a low-level rails app and I really like Heroku, but if my app allows each user to upload one picture, I may run out of space quickly...is there a simple solution that will allow me to have alternative file storage for profile pics or something of the like? 回答1: See this blog post In your model. has_attached_file :picture, :styles => {:large => "275x450>"}, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path =>

How to copy InMemoryUploadedFile object to disk

半腔热情 提交于 2019-11-27 11:27:26
I am trying to catch a file sent with form and perform some operations on it before it will be saved. So I need to create a copy of this file in temp directory, but I don't know how to reach it. Shutil's functions fail to copy this file, since there is no path to it. So is there a way to do this operation in some other way ? My code : image = form.cleaned_data['image'] temp = os.path.join(settings.PROJECT_PATH, 'tmp') sourceFile = image.name # without .name here it wasn't working either import shutil shutil.copy(sourceFile, temp) Which raises : Exception Type: IOError at / Exception Value: (2,

How to store a file on a server(web container) through a Java EE web application?

本秂侑毒 提交于 2019-11-27 07:20:31
I have developed a Java EE web application. This application allows a user to upload a file with the help of a browser. Once the user has uploaded his file, this application first stores the uploaded file on the server (on which it is running) and then processes it. At present, I am storing the file on the server as follows: try { // formFile represents the uploaded file FormFile formFile = programForm.getTheFile(); String path = getServlet().getServletContext().getRealPath("") + "/" + formFile.getFileName(); System.out.println(path); file = new File(path); outputStream = new FileOutputStream

How to copy InMemoryUploadedFile object to disk

给你一囗甜甜゛ 提交于 2019-11-26 15:35:01
问题 I am trying to catch a file sent with form and perform some operations on it before it will be saved. So I need to create a copy of this file in temp directory, but I don't know how to reach it. Shutil's functions fail to copy this file, since there is no path to it. So is there a way to do this operation in some other way ? My code : image = form.cleaned_data['image'] temp = os.path.join(settings.PROJECT_PATH, 'tmp') sourceFile = image.name # without .name here it wasn't working either

How to store a file on a server(web container) through a Java EE web application?

早过忘川 提交于 2019-11-26 13:09:13
问题 I have developed a Java EE web application. This application allows a user to upload a file with the help of a browser. Once the user has uploaded his file, this application first stores the uploaded file on the server (on which it is running) and then processes it. At present, I am storing the file on the server as follows: try { // formFile represents the uploaded file FormFile formFile = programForm.getTheFile(); String path = getServlet().getServletContext().getRealPath(\"\") + \"/\" +