I wrote a Grails project which does speech processing and produces several speech files. I saved the files in a folder in the root of the project for example:
..\\MapCloudWebServices\\speechdata\\123456.wav
When I run-app everything is working correctly and all the files are produced and saved in the the mention folder (speechdata). But we I run URL from the browser (localhost:8080/MapCloudWebServices/speechdata/123456.wav) I got the error message (http 404) that the requested resource is not available!
Could anybody help me how to assign the data in Grails project folders to appropriate URL on server? (maybe in config file?)
Thanks,
Reza
You need to put your static content such as your wav files under the web-app directory of your grails project.
Related
I am using Grails 3.1.1
Last month, I had my project, but my hard-disk became corrupted because of a bad sector. I tried bringing my hard-disk to a "Recovery DATA"'s store.
But that store cannot recover my data, so my project's data is gone now.
But I still have the War file on my customer's server.
I just want to know: Is it possible to get my project back from a War file?
My War file is still running on the server, but all my source code is gone.
No it's not possible to recover your entire project, including source code, from a WAR file. The WAR contains the compiled version of your code, not the source.
If you don't have any option and need to rewrite the application again, I'll suggest some ways:
Remove your hard-disk from laptop/desktop. purchase HDD internal sata to external USB case for desktop/laptop hard disk. which connects with connectors with circuit(Sometimes this helps you in boot-sector error also).
Connect it to the laptop and check is it showing HDD. If yes check data is available not. If HDD size showing correctly but data not available then you can recover data with " EaseUS Data Recovery" software.
If all above fails?
Copy your project war from server to local computer.
Install WinRAR or any other unzip software.
Select and open your war file with it.
See above screenshot,
Where assets folder contains js, css, images and all your other files.
which may be minified if you set minifyJs = true and minifyCss = true in your application.yml
Now, see very important folder called WEB-INF
See above image which contains two folders:
classes : This is very important folder which contains your controllers class files and gsp files.
Controller files are .class files where for each action from controller will generate separate .class file. You can de-compile dot class files using many online/offline tools.
In case of gsp you will get original files.
Also you will get application.yml and other files as it is.
Hope it helps you.
I'm trying to create a Grails 3 web interface with an upload form that writes zip files to a folder on the server.
I have already tried a lot of plugins or solutions that can be found here but nothing seems to work.
My code can be found on github (https://github.com/rm93/BIGC).
Would anyone know a solution that I could apply?
I have found a solution to my problem. Instead to give a path to the transferTo method i now I give it a new file.
fileUpload.transferTo(new File("/path/to/folder/data.zip"))
I project myself that I used the MVC used for managing files from Roxy File Manager! Everything is correct and complete project works!
My problem is when the server I'm Publish project was a project file, but the file does not show !!!!! I do not know where is the problem?
I "main.ashx" settings is as follows got the "GetFilesRoot"
ret = _context.Server.MapPath("/Uploads/Web");
This is when the host is not the answer! I also tried different ways !!
With ~ no ~
With . . Without . .
First /
The first / deleted
Just put ~
I tried every way I knew it was not OK, but that was not
It's my system files run the show
It does not run on the server where the file
Probably your web server doesn't know how to serve .json files.
Open IIS Manager.
Display properties for the IIS Server.
Click MIME Types and then add the JSON extension: File name extension: .json and MIME type: application/json
More info
In my Rails project, I noticed that when I put some files into my public folder, such as .html, .pdf, .jpg, they can be opened via a browser. But when I put other files, such as .txt or files with no file type, permission is denied.
Forbidden
You don't have permission to access /blog/public/test.txt on this server.
Where is this permission controlled?
Actually, it's interesting that the file robots.txt, which came automatically when the Rails project was set up, can be accessed! But test.txt, which I created, cannot be accessed.
Try restart the server and see if it works. It usually works in rails 3 like breeze, but you might be on an older version of rails.
I guess it is the asset pipeline which allows the html, css and js files only...
I am developing asp.net mvc web application in VS2008.In my project,users will upload their files.So that,we created a one folder and made virtual directory in IIS for it.That is just simple folder to store the files.But that folder path is not same with our application path and it is a separate folder.
For eg : upload folder path is "http://localhost/uploadfolder" and our application path is "http://localhost/TestApplication
I use Server.MapPath("~/uploadfolder") to get that upload virtual directory path but it returns like "http://localhost/TestApplication/uploadfolder" and I got error message "Upload directory not found". I also tried like Server.MapPath("http://localhost/uploadfolder") but still can't to upload.
My question is how can I point to that path from my application? How can I upload the files? I haven't hosted yet my application in IIS and I run it from Visual Studio.Please guide me the right way.I really appreciate your answer.