Adding static PDF file to nuxt js project - vue.js

I have a project in vue and I want to build it with Nuxt.
I have link in footer that I want user to download a PDF file by clicking on it , it works fine on local server but when I build the project I can't find the pdf file .
I stored the file in Static/documents folder

You have to put the .pdf in the static folder. Then to see you go to http://localhost:3000/yourpdf.pdf (localhost o your domain)

Perhaps you forgot to push it the server ? How your are deploying your application ? using git ? if yes check if there is files in the stage with "git status" command
Did you try to access to yourdomain.com/documents/yourfile.pdf ?

Related

How to access Angular 8 website without using base-href folder name in browser

I have angular 8 website which I build for production using following command:-
ng build --prod --configuration=production --base-href /eportal/*
I have created a folder "eportal" in hosting site and uploaded all components in the folder. It all worked fine and I can browse to the site using following url:-
www.abc.org/eportal/login
Is there any method or any command available in Angular 8 where I can keep my components in "eportal" folder in hosting site but access in this way(removing folder name):-
www.abc.org/login
Please help me on this.
First of all the —prod flag is an alias to —configuration=production. Please take advantage of this
Coming to the question in particular, use the following command
ng build —prod
There should be assets generated in your dist/[app-name]/ folder.
In your hosting site, instead of uploading those assets in the folder you created upload them outside.
ie. You would have uploaded your assets in public_html/eportal instead of that upload them in public_html directly.

unable to include external files in a project

I have created the default play application in IntelliJ in directory P. I have over-written the default index.scala.html with my own html code. The html code refers to some css and js files which are outside the directory P. To include these external files, I added the directory of these files using project configuration settings.
My webpage doesn't load properly as the server returns 404 for the css and js files. What am I doing wrong?
When you added your directory using project structure, you only say:
Hey, IDEA, please consider this folder part of my project, consider
its contents source code and display it when I open my project.
However, when you deploy or run your app, you only deploy the usual folders to the server, which contain the resources which will be available for clients to access.
The external directory is not part of these directories and will not be deployed.
What you can do is to copy the file from the external directory as a part of your build process before deploying the application.
EDIT: Detailed answer here: What is intellij's build process for play applications

load local files outside NWJS app

When I work locally I want to share code among two or more (nwjs and other kinds of) projects. Folder structure:
-project 1
-project 2
-shared code
When releasing the apps I build the external files into a file inside each project app.
But I cannot access files outside the node-webkit/nwjs app folder.
I tried things like:
Setting "chromium-args": "--allow-file-access-from-files" in the manifest file but I think this is default now.
Using file:/// and chromium-extension:/// prepending the relative paths but I think this is only for absolute paths?
Load files dynamically and using path.relative( process.cwd(), "../shared_code/scripts/controllers/searchController.js" );
The user of the app will be able to put it anywhere on his computer.
Is it possible to load js and css files and images from outside the nwjs project folder locally?
nwjs sdk version 0.19.5
I had a similar problem trying to load images outside of the NW.js application. I found that this fixed my issues. Try adding this to your JSON manifest file. This worked for me...
"chromium-args": "--allow-file-access-from-files --allow-file-access --user-data-dir"
Just so you know, I had originally tried this...
"chromium-args": "--allow-file-access-from-files --allow-file-access --user-data-dir --mixed-context"
But it stopped jquery loading.
You can then access files with file:/// and use absolute paths anywhere on the machine.
I hope that helps.
For sharing code, when the code is (or can be) a node module, it's very helpful to be able to npm link it into your project. (It works the same with NW.js apps as for Node.js:)
cd shared-code
npm link
cd ../project-1
npm link shared-code
cd ../project-2
npm link shared-code

Where does intellij idea save the local storage and preferences of libgdx (pc)

I started working with files, a simple operation of writing and reading files.
But i had an error when writing a file and now i have to fix it by hand.
Thats the problem, i don't know where is my file.
Also i would like to see the file i'm writing.
I am working with intellij idea 2016 1.4, maybe the file is complied in a jar?
Yes, i know that clearing cache its an option.
nothing here: https://github.com/libgdx/libgdx/wiki/File-handling
on the wiki link only talk about where you can find the ablolute path file but thats not my case. I get the file this way:
this.resolver = Gdx.files.local(path + "item"+ String.valueOf(weaponNumber) + ".txt");
String description = this.resolver.readString();
So.. where is the file? thanks
In the desktop version it saves the file in the assets folder inside your android module.
FileHandle file = Gdx.files.local("myfile.txt");
file.writeString("Test libGDX", false);
System.out.println(Gdx.files.getLocalStoragePath());
Output: D:\Dropbox\Projetos\Outros\gdxTest\android\assets\
The project folder in my computer is gdxTest.
In your case you have the path var so probably will be a folder inside assets folder.
But when you pack the desktop game into a jar file, the file will be created in the same folder where your game jar file is located. Usually yourProject\desktop\build\libs.
The difference is because when we configure the desktop project we set the Working Directory in the yourProject\android\assets\ folder. So to Android Studio it is the local folder of your project.

Laravel wrong public path file upload

I've deployed laravel with this guide.
http://juniorgrossi.com/deploying-laravel-applications-on-a-shared-host/
On my webserver I have a public_html file now containing all my publicly accesable files and a laravel folder containing the rest, so I've split up the default laravel structure for deployment.
On my development server by default the public folder is resting inside the laravel folder instead of being on the same directory level.
The problem I'm getting though is when I use something like this:
// Upload the file
Input::upload('image', 'public/uploads', $filename);
Same with this.
// Upload the file
Input::upload('image', path('public') . 'uploads', $filename);
Instead of trying to use the uploads folder that is inside my public_html folder it tries looking for a public file inside my laravel folder now.
And I get a
Unable to create the "/uploads" directory
Ofcourse on my development server the public folder is still inside the folder so it's logical.
How do I fix this?
You may try this (add a slash after the folder name)
Input::upload('image', path('public') . 'uploads/', $filename);
Maybe try this....just as a test
Input::upload('image', URL::to_asset('uploads/'), $filename);
You can also try
Intervention/image package.
I'm using this and I find it very easy to use. It also has a resize and crop feature.
It's easy as:
Image::make(Input::file('file')->getRealPath())->save('uploads/' . $filename);
Fixed the paths.php to ../public_html
I've done this before but it failed since I accidentaly uploaded a png and my jcrop function wich crops and saves images failed because it currently onlt takes jpg. So that left me thinking my paths.php settings were no good while they actually were.
Thanks for helping out though everybody!
(I feel like a fool.)
In my case, I got the same problem. Then I created it manually, CHMODed the lil' bastard and it worked fine!
Making a long history short (not so long...): just permission!
If you have the permission to Write/Read to the folder, you'll be cool! If you don't, you change the permissions! If you are unable to change it, put the uploaded files where the permissions allows you to access the file.