Technologies used:
Frontend: Angular JS
Backend: SQL
We need to upload all formats of files into SQL DB by using Angular JS and need to download the uploaded files. Here by using some methods we are converting the uploaded file into "Blob" Format and stored in SQL.
After insertion into SQL we are trying to download the file in same format. But here we are able to download only text format files by using "ng-filesaver" concept. But remaining file format are not able to download. So which concept we need to use to download any format of files by using AngularJS. Please help us we are working from last 15 days on this.
Related
I have generated swagger document for web api using below link:
http://wmpratt.com/swagger-and-asp-net-web-api-part-1/
Need to export document in PDF or XML file to send across handy.
Its .NET WEB API.
How to export swagger documentation ?
Thanks
Here's what I did today, since many of these other projects require laborious workarounds or extra libraries or some completely separate language.
Go to https://editor.swagger.io/ (Make sure it's the HTTPS version)
At the top, click File => Import File.
Select your Swagger JSON file.
At the top, click Generate Client => HTML2 and download the ZIP file.
This yields a static HTML page that you can then print (via the browser) to PDF using the built-in Microsoft Print to PDF printer, or Adobe Acrobat, or whatever else you might want to use.
You can use Swagger2Markup and AsciiDoc docker images:
docker run --rm -v $(pwd):/opt swagger2markup/swagger2markup convert -i "https://api.example.org/api/doc/swagger.json" -f /opt/swagger-doc
Creates asciidoc file named 'swagger-doc.adoc' in current folder.
docker run -it -v $(pwd):/documents/ asciidoctor/docker-asciidoctor asciidoctor-pdf swagger-doc.adoc
Creates a PDF file named 'swagger-doc.pdf' in current folder.
The Swagger2Markup project is on GitHub and some more information you'll find by using Google too.
Swagger2Markup converts a Swagger JSON or YAML file into several AsciiDoc or GitHub Flavored Markdown documents which can be combined with hand-written documentation.
AsciiDoc is preferable to Markdown as it has more features. AsciiDoc is a text document format for writing documentation, articles, books, ebooks, slideshows, web pages and blogs. AsciiDoc files can be converted to HTML, PDF and EPUB. AsciiDoc is much better suited for describing public APIs than JavaDoc or Annotations.
You can generate your HTML5, PDF and EPUB documentation via asciidoctorj or even better via the asciidoctor-gradle-plugin or asciidoctor-maven-plugin.
The project requires at least JDK 8.
See also RESTful API Documentation with Swagger and AsciiDoc
Their is no such tool or functionality to export swagger documentation into PDF or any other doc. You need to convert your swagger.json file to yaml file then u can get swagger as html doc form http://editor.swagger.io/.
I was trying to upload and download files at application level using jelastic server in cloud and I have some issues during downloading the uploaded files
to upload the files I use:
File folder = new File(".." + File.separator + "customFolder");
and the files are uploaded correctly inside of:
/opt/GlassFish/glassfish/domains/customDomain/customFolder/
and I can see the files using jelastic dashboard and ssh
but, if I try to download them through application I have a 404 error
using this kind of approach
Link
I try to use the instructions posted here
Cann't get file from classpath (using NIO2)
but this doesn't work for me. Also I try to use some paths also posted in jelastic documentation (https://jelastic.zendesk.com/hc/en-us/community/posts/206122066-Uploading-Files-to-a-Specific-Folder) but noticed there is no a clear explanation for Glassfish.
Also I figure out that the files are in different locations inside of jelastic application folders
these are the different locations that I have found and tried to use to downloading the files (I changed the access permissions, also without making a successful download):
/opt/GlassFish/glassfish/domains/customDomain/customFolder/
/opt/repo/versions/4.1.1/glassfish/domains/customDomain/customFolder/
/opt/shared/glassfish/domains/customDomain/customFolder/
so my question is
what is the correct path to download the files or should I change the upload path?
an example using java code returning the string with the path for download would be appreciated
I'm using Glassfish 4.1.1 for the application
My goal is to locally save a BigQuery table to be able to perform some analyses. To save it locally, i tried to export it to Google Cloud Storage as a csv file. Alas the dataset is too big to move it as one file, thus it is splitted into many different files, looking like this:
exampledata.csv000000000000
exampledata.csv000000000001
...
Is there a way to put them back together again in the Google Cloud Storage? Maybe even change the format to csv?
My approach was to download it and try to change it manually. Clicking on it does not work, as it will save it as a BIN.file and is also very time consuming. Furthermore I do not know how to assemble them back together.
I also tried to get it via the gsutil command, and I was able to save them on my machine, but as zipped files. When unzipping with WinRar, it gives me exampledata.out files, which I do not know what to do with. Additionally I am clueless how to put them back together in one file..
How can I get the table to my computer, as one file, and as a csv?
The computer I am working with runs on Ubuntu, but I need to have the data on a Google Virtual Machine, using Windows Server 2012.
try using the following to merge all files into one from the windows command prompt
copy *.cs* merged.csv
Suggest you to save the file as .gzip file, then you can download it from Google Cloud easily as BIN file. If you get these splited files in bigquery as following:
Export Table -> csv format, compression as GZIP, URI: file_name*
Then you can combine them back by doing steps as below:
In windows:
add .zip at the end all these files.
use 7-zip to unzip the first .zip file, with name "...000000000000", then it will automatically detect all the rest .zip files. This is just like the normal way to unzip a splitted .zip file.
In Ubuntu:
I failed to unzip the file following the method I can find in internet. Will update the answer if I figure it out.
Right now, i am working on a go ahead embedded web server. i have an old 2.1 version of this server, which was open source. i want to upload .json file which i create from the firmware, to the web server and then want the page to process that file using flot tool,and display a graph.but that version does not support file uploading capability. on internet i have found that the new version of this web server support the file upload capabilities, but i have not found a proper example which explains the syntax that i would use to upload the file. can any one tell me which functions of this new version i would have to use to get things working.
can any one give a proper full example.
You ask how to upload using goahead.
When you build the source, it should build a test executable called goahead-test. This uses test/test.c as a main program. Test.c defines an upload action handler that is invoked when you do a file upload to the url /action/uploadTest. This handler will echo back to the browser the various file upload details. You can cut/paste from test.c into your own main program.
I've got some data files that are stored compressed on our company's server with a .Z extension (UNIX compress utility used to zip them down).
Can SQL Server's BULK IMPORT operation read these files in that format? Or must I uncompress them before getting at the data?
The BULK IMPORT would not natively be able to do this however if you are on SQL2005 or greater you can use SSIS. The first step would be to perform an Exectute Process Task and use a zip utility to unzip the file. The second step is to use the SSIS Bulk Insert task to push the data into SQL Server.
EDIT: use the compress from unixutils rather than cygwin to uncompress the files as it understands native windows filenames. This means that you don't have to maintain /cygdrive paths as well as native paths.