Is it possible to upload entire folders in ASP.NET? - asp.net

The file upload control in asp.net does not allow me to select a folder and enables me to select only the files. Is there any way in which I can select a folder (obviously without using the file upload control).
Why I want to select the folder is basically to store its entire path in a database table.

The HTML <input type=file> element only supports single file uploads. If you to have multiple file upload, you would have to use a 3rd party component - usually written in Flash.
Here an example: http://www.codeproject.com/KB/aspnet/FlashUpload.aspx

No, browsing for files are the client-side feature, and the only information about file path is their name. It's cause security.

I dont think HTML supports what you are trying to do. Perhaps as a workaround you can have them select a file in the folder and then chop off the file name when processing it but thats a mess to be honest.
Ask them to Paste or type the path into a textbox perhaps. The issue here is you cant check for typos.
Id say you should rethink what you are trying to do.

Related

How to edit the style of multiple Oracle Apex applications in a workspace

I want to edit the style of multiple applications inside my workspace with the less amout of effort. What I mean by "edit the style" is font size, background color, position, etc.
My idea was creating a CSS file at "Static Workspace Files" with the classes I want and applying them to the apex items needed. Applying this in a region for instance:
*.font16{
font-size: 16px;
}
The problem is: modal pages can't find the file, which is not a problem in nomral pages. I'm using the path '#WORKSPACE_IMAGES#styles.css' in the page "CSS > File URLs" setting.
I'm not sure if this is the right approach, maybe I should edit Themes or Templates, but since I'm pretty new to Apex I chose CSS for familiarity.
Application Express v20.1
That's what Static Workspace Files are meant for, files that can be used by multiple applications in the same workspace.
The easiest approach for this is to create a CSS, like what you've done.
You don't need to inlcude the file in every single page, which would become a maintenance nightmare eventually.
You can simply include the file at the application level:
In Share Components, go in the User Interface Attributes and include the file under Cascading Style Sheets.
I usually have one global.css file (as a static workspace file) for anything common to all my apps and one app.css per application (as a static application file) for things specific to the current application.
Note that application exports will contain the static application files, but they will not contain the static workspace files. You will need to export/import them yourself.
Did you try Theme Roller? Run the page, it is down in developer's toolbar.

Meteor - Multi File Select UI to CollectionFS

I've been using yogiben/meteor-autoform-file, which is pretty awesome for uploading files directly to CollectionFS! However, uploading many files is a pain for the user: The user has to click the "+" icon once for each file to upload, and then select each file individually.
I could also use something like Blueimp JQuery File Upload for the multi-file select, but then the files don't get written to CollectionFS.
Is there an easy way to do multi-file select and have the files written to CollectionFS?
I used https://github.com/tomitrescak/meteor-uploads in a previous project. It supports collection-fs, has drag-n-drop and multiple files features. Maybe not as simple to put in place than yogiben's package but still. Take a look as it might fit your needs.

How to avoid browser caching issues by renaming css file

If i have some bad css in site.css file and this has been cached from the user's browser, is it then possible to simply rename the file with the fixed css in order to have the user's browser reload data that had been formerly cached?
If not, is there a way to mimick clearing a browser cache?
Thanks
If you simply add a dummy querystring value to the css reference the browser will get a fresh copy of the file since different url means different resource. For instance
styles.css?anything=1
Renaming the file would work too but that's not necessary.
Yes, you can save the new css file with a new name and edit all files that use the css file to use the new version.
A fake query string like
styles.css?revision=2
or
styles.css?lastchange=2012-09-21
in all files that use the css file also forces all caches to get the updated file.
The advantage is that the file name doesn't have to change.
The drawback is that you won't notice easily whether the old version is still in use somewhere (perhaps because you forgot to update a file). If you instead change the file name, you can leave the old file up for some time and check the logs if it's still accessed to give you this information.

asp.net - Include CSS file only one

I'm stepping in to a project that has been going on for a few years.
One of the issues I saw immediately is that CSS files are being included in the master pages, the aspx pages, user controls and more, and also style sheets are created and imporeted via aspx files, and not linked. (A mess, I know)
It becomes impossible to debug styling issues.
What would be the best strategy for removing the double imports? Is there any built-in method to insure files are imported only once?
Thank you!
One way will be to have all CSS files embedded as resources then use Page.ClientScript.RegisterClientScriptResource.
Another way is leave the files as they are now and use Page.ClientScript.RegisterClientScriptBlock to include them after checking if already included by Page.ClientScript.IsClientScriptBlockRegistered giving it the unique key used in the Register method.
Either way, you'll have to remove the CSS includes from the .aspx itself and put it in the code behind.

Uploading all files in a folder with Flex

I want to make a file uploader with Flex.
However, I want it to select a folder and upload all the files in the folder.
It would be much better if I can actually check the files before uploding.
I'm using Flex with JSP in the back-end.
Is there a way to do this?
So far, all I found from googling around is how to make file uploader for uploading a single file.
You can upload multiple files using the FileReferenceList class. There is an example at the bottom of the link.
When the FileReferenceList.browse() method is called and the user has selected one or more files from the dialog box that the browse() method opens, this property is populated with an array of FileReference objects, each of which represents the files the user selected. You can then use this array to upload each file with the FileReference.upload()method. You must upload one file at a time.

Resources