Apache file upload (resource PUT DELETE) without CGI/PHP - apache

Is it possible to configure Apache to support CRUD operations on file resources? GET works out of the box, how can you make PUT and DELETE work?
I would need to upload a file by HTML form and/or XMLHttpRequest2.
No PHP. No CGI. Just plain Apache by configuration.
Is this supported in other web servers? I'm trying to find a static REST interface for file resource management without CGI/PHP/Connector/Reverse Proxy/FTP server.

Related

Virtual Directories not working in ColdFusion Builder 2016

I'm trying to set up virtual directories through the built-in Apache Tomcat 8 server using the ColdFusion Builder 2016 interface, however to my surprise this simply does not work, yet according to the documentation it should.
The only thing that I've modified was the web root directly in the server.xml file.
That said the website runs correctly, except when trying to reference a resource from a virtual directory which simply returns HTTP Status 404.
Web Structure
ColdFusion Builder Interface
The process when using the interface is as simple as:
Creating a virtual host;
Clicking the "Virtual Directory" button and setting up the directories; and
Applying the changes and restart the local server.
Ultimately this should allow me to navigate to the files (CSS, JS, Images) directly through the web browser.
Could I be missing a specific setting in a configuration file due to manually changing the web root? If not what am I missing?

Export file from NetSuite's FileCabinet to FTP

File resides in the NetSuite file cabinet and needs to be placed on an FTP server each day.
I'm not sure how to handle this via Suitelet/RESTlet, or if it's possible - but would prefer to not use an external source/application.
My current and hopefully temporary workaround is a local scheduled task to run a script to pull files from NetSuite & upload to the FTP.
In SuiteScript 2.0, although unsecured FTP is still not support, but SS2.0 has the capability to do SFTP. See http://www.upilioconsulting.com/blog/netsuite-2016-2-sftp-suitescript-2-0/
In SuiteScript 1.0, it's not supported. The workaround is that you'll need to write a middleware code (i.e. in PHP) and let the middleware do the FTP transfer.
Netsuite doesn't interact with FTP.
You need a bridge server of some sort that runs a web app (full blown Apache or nginx running PHP or just a simple Node service)
Just get a server and install some web server/web service and POST your files to it (nlapiRequestURL with a Scheduled script). Have the web app on the bridge server send the files to the FTP server. If you are using Netsuite you can afford the cost of the bridge server.
One possible solution is to create a saved search on the Documents to list out all the files in Netsuite filtering by createdate or lastmodifieddate. Create a scheduler to fetch only the new files and save them locally where you want.
Note all the files will be in base64 encoded string format, you need to decode again to obtain the file.
As bknights said NetSuite doesn't support FTP. You need a web server(any server side language can do for that matter, I have written one in Node.js), to receive the files.
The file content for text file will be in Text format, so, no decode logic required for text files. However, binary/pdf/image and other would be in base64 format, as NetSuite's JS has no way of handling binary data. So, make sure you decode it before you create the file on your FTP Server.

Disallow direct access to subfolder from external IP Addres

In the process of moving an application from ColdFusion to PHP, I have a ColdFusion server running on CentoOS using apache. Despite a correct robots.txt disallowing the indexing of my application it has come attention that some files from the clients were indexed.
I need to know how to set up apache to only allow access to file from the server itself and NOT allow anyone to access the files from the inter-google. SO if you were to click the link it would deny access, but if you were to attempt to download it from the application itself (using a download script) it would allow it to download. Is it possible and how?
LOVE that the search engine ignored my robots.txt. Thanks!

Accessing Local Media File to Play in FlowPLayer

I want to access local media file say .mp4 file to play in FlowPLayer on Firefox browser..
My application is based on JSF and RF3.3 with JBoss server.
Problem is in my backing bean say I have written a file name as test.mp4 and the same is being present in WEB-INF folder..FlowPlayer will access this file using:-
http://IP/ContextPath/WEB-INF/test.mp4
But now say suppose I have a file placed in my D: drive on my system. The local server is running on my system.I want to access the file kept in D: drive and play it in flowplayer...
FlowPlayer always append http://IP/ to the file name and as such it won't play the media file..
Is there any way out to allow flow player to access local file on the system...
I figured that it can be done using Apache...But how/??...
The component accepts a URL that must be accessible from the client browser, thus a url like file:///C:/resources/foo.mp4 would not work. The resource file you are trying to reference must be accessible from a web context. That is not to say that you can't store the file resources on the D: of your machine, but you would need a web server like Apache to access that folder location as a web context folder. It can be configured to do this, but I will not go into the details of how to do this, if you have trouble with that then you should post a question to the ServerFault StackExchange site for help with this.
One thing to keep in mind is that your web application is likely configured that any resources within the WEB-INF folder of your project is likely set to be the context path of your application. Thus if you you were to place your MP4 file in your web app (i advice against it, those files are enormous), then it would be accessible from http://site:port/applicationcontext/resources/foo.mp4 but on disk it is WEB-INF/resources/foo.mp4.
The best way that I set this up is to set up an Apache front end that is listening for web traffic on the specific port, then using the mod_jk module you can have Apache forward requests for resources at http://site:port/applicationcontext/ to your application server on the AJP port. I like this setup because I can keep large static resources at the ROOT context of the web server, as well as protect my application server by keeping it completely behind a firewall and inaccessible from the outside. The application server can only be accessed through the Apache web server meaning increased security. For more information on this type of setup, see this example guide on how to setup Apache Web Connector with Tomcat. http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html

How do I get a status report of all files currently being uploaded via a HTTP form on an Apache Server?

How do I get a status report of all files currently being uploaded via HTTP form based file upload on an Apache Server?
I don't believe you can do this with Apache itself. The upload looks like nothing more than a POST as far as Apache cares. There are modules and other servers that do special processing to uploads so you may have some luck there. It would probably be easier to keep track of it in your application.
Check out SWFUpload, its uses Flash (in a nice way) to assist with managing multiple uploads.
There are events you can monitor for how many files of a set have been uploaded.