How to create folders and images using AngularJS - angularjs

I have an AngularJS app that, upon requested to upload an image, creates a folder inside the file system (CentOS) and then puts that image there, telling the user everything went OK or not.
Is this possible? All I've found is ways to download the file.
Thanks.

It is better to delegate this task to a service on the server, since it is file that is uploading to a server. I put simple rest service to file upload this file to the server.

Related

File upload in Moodle using jmeter

I'm busy setting up a load test for file upload in moodle and I am struggling with the file upload. It seems to be losing the sesskey when it gets to the uploading of the file.
Here is the error message from the response data:
"{"error":"A required parameter (sesskey) was missing","errorcode":"missingparam","stacktrace":null,"debuginfo":null,"reproductionlink":null}".
Please help, this test needs to be done in the next 2 days.
Thank you in advance.
I extracted the sesskey using the Regular Expression Extractor and this worked for downloading a file and taking a quiz in moodle but for file upload it loses the session.
Just record the file upload event using HTTP(S) Test Script Recorder, the only thing you will need to do is to copy the file(s) you will be uploading to "bin" folder of your JMeter installation prior to starting the file upload in the browser, this way JMeter will be able to properly capture the request and generate the relevant HTTP Request sampler and HTTP Header Manager
See Recording File Uploads with JMeter article for more details.
Once you have recorded "skeleton" you can correlate the dynamic values like sesskey

Extracting zipped images from utf-8 encoded reponse of a rest api call and displaying those images to user in react without downloading

I have a zipped file containing images which I am sending as response to a python REST API call. I want to create a rest application which consumes the python rest api in this manner: The response's content should be extracted without downloading (in browser side) and all the images should be displayed to the user. Is this possible? If yes, could you please help me in the implementation? I am unable to find help anywhere.
I think what you are trying to do is have a backend server (python) where zip files of images are hosted. You need to create an application (that could be in react) that
Send HTTP calls to the server get those .zip files.
Unzip them. How to unzip file on javascript
Display the images to the user. https://medium.com/better-programming/how-to-display-images-in-react-dfe22a66d5e7
I'm not sure what utf-8 has to do with this, but this is possible. A quick google gave me the results above.

Upload file is not working using AngularJS on lighttpd server

In my current project we are using lighttpd server. Here I am trying to upload the file. I am getting two Response Headers, first is with 301 Status code (Moved Permanently) and second is with 200 (OK).
But when I am checking in the folder I am not able to find any file (I mean no file uploaded).
I have tried both way to upload file as given links below:
http://jsfiddle.net/danialfarid/0mz6ff9o/135/
ngFileUpload
https://jsfiddle.net/JeJenny/ZG9re/
In both way I am getting the same response.
So here I have some sort of questions:
1) Is file upload is possible using AngularJS only? (No Server Side Script)
2) If possible, Is there any config problem with lighttpd?
Thanks !
Need Help...
The server side (or any web server) must be configured to handle POST and PUT requests. CGI, FastCGI, SCGI scripts can be written, or you can proxy to another backend. For simple file uploads, lighttpd also provides mod_webdav which you can configure (and protect with mod_auth) to allow you to upload files without having to write any server-side code.
https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModWebdav

angular file upload and preview

I am using ng-file-upload library to post files to my back end Web Api. Once the file is posted I save it to the following folder
"~/App_Data/Tmp/FileUploads/"
and also save the path to my database.
Now when I go on edit mode; I want to get a preview of all uploaded files (photos). But when I use something like
ng-src="path"
I get
"Not allowed to load local resource"
is this the right approach, when serving files from disk?
That path is a server path and not a client path so for sure that won't work.
You need to have an endpoint on your server to allow downloading those files with id or name/path and then set the src of the img to that url.
The implementation download endpoint depends on your backend technology.
If in your edit mode you still have access to the file object that use has just selected then you can do:
<img ngf-src="file">

How to get file in Silverlight Application?

Suppose, we have a sivlerlight application - SLApp. SLApp is located on the WebSite someweb.com. Link on file likes this - someweb.com/SLApp?URL="https://smthg.com/file.exe" .
How to get this file in the silverlight app&
It's difficult to understand what you want from your question:
For getting a file from the client machine and sending it to the server:
You can't do that directly, it's a security risk, and hence disabled. You can only access files via the file open dialog.
For getting a file from the server to the client:
Now if you are wanting to download a file to the client via a link, then you can just open a web page with the link/url, that way you use the standard browser functionality.

Resources