How to check file size upon upload? - image

I am using Liferays asset publisher and trying to configure the web content to handle images and documents. The document upload can be handled by the document library that liferay has to offer but when images have no such place. The template for the web content is written in velocity. Is there a way within velocity to check file extensions and size when uploaded? Or if there are any other ways this could be handled?
I just got done messing around with Liferay 6.1 Beta3, it is still buggy but not as bad as the trunks. The asset publisher has some improved features which include the document library having a folder structure. I think this is the way I am going to go, is just have any file used within the web content must be pushed through the document library. Also unrelated to the question the web content now has the feature to localize both the title and the abstract. Hopefully they get all the bugs fixed by release time...

Have you tried Control Panel -> Server Administration -> File Uploads
In that you can specify the Overall Maximum File Size ,Maximum File Size and allowed extensions for Document Library,Maximum File Size and allowed extensions for Images and Maximum File Size and allowed extensions for Web content images.

Related

How to get full image paths from web page using Firebug?

I would like to download all images in full quality from this blog: http://w899c8kcu.homepage.t-online.de/Blog.
I have access to server, but I can not find the directory where the images lie. When I use Firebug on the first picture, it shows me http://w899c8kcu.homepage.t-online.de/Blog;session=f0577255d9df9185d3abe04af0ce922d&focus=CMTOI_de_dtag_hosting_hpcreator_widget_PictureGallery_15716702&path=image.action&frame=CMTOI_de_dtag_hosting_hpcreator_widget_PictureGallery_15716702?id=34877331&width=1000&height=2000&crop=false.
How can I find the file paths like /dirname/image.jpg?
According to its HTML output the page obviously uses the CM4all content management system (CMS).
I don't know how precisely this CMS is working, though generally CMSs normally either save the files under cryptic names within a folder specified in the CMS's configuration or not in the file system at all but within a database.
Also, CMS may only save compressed or resized versions of the original files.
So, if you don't want to or are not able to dig into the server-side script code to find out if and where the images are saved, you should contact the company behind CM4all about this.

updating existing site built in dreamweaver, handling DWT file

I have a client that want's me to make a change to her OTHER site. The other site was built using Dreamweaver.
I guess (I don't build using Dreamweaver) the site pages are being controlled by the template file EXCEPT for the content that is specific to the page.
So I need to change the navigation items.
I found a folder called templates and in that folder is the template.dwt file. I tried copying that file to my desktop, then making the change and uploading back to the ftp site. Of course that had no effect on the nav items. My guess is the file on my desktop does not know to update the other pages as it doesn't know where those pages are.
So how do I go about making the changes to the files on the ftp site using the DWT file?
Do I have to download ALL the html files and the DWT files and somehow create a relationship so when I make the change to the DWT file it updates all the pages on my desktop THEN re-upload all those files back to the ftp site?
Thanks
My guess is that you already figured this out, but just to be sure. You're question is right, the DW template works by when the template is modified (in DW) then you can update all the pages that are linked to it.
If you take the template out of DW and just modify and upload that alone, then nothing will happen to the other pages. So yea, if you know a way to create a link between the template and the other files outside of DW, then that is what you need to do. The other option is using DW and modify the template and then update the other pages, which is done in a semi-automatic way. Semi-automatic, meaning that DW gives the option to update the files either once you save the template or you can save the template and update the files later using DW.
And your guess is correct, the template modifies areas that are not specific to a page. Usually, this is done by creating Editable Regions in the template. Those regions are excluded from change when the template is modified.
You have to create a project in DW and put inside all the files that are "linked" with the template. They usually have tags inside that refer to the template.
Make sure that you keep the same file and folder distribution that the original had. If not, you could have a mess with relative links.
Then, with your template also in the project, open and modify it.
When you save the template, DW will ask you for scan and update related files, if you are lucky it will find and update all of them.

dnn filepickeruploader control

Am developing a module for DotNetNuke 7. I want to be able to upload a thumbnail image for entries in a catalogue. Have managed place control in edit view of my module and upload and select files however when I build the project I get the following error:
C:\dnn\dotnetnuke\DesktopModules\EventCatalog\Edit.ascx.designer.cs(103,38,103,41): error CS0234: The type or namespace name 'Web' does not exist in the namespace 'DotNetNuke' (are you missing an assembly reference?)
Also I can't figure out how to get the selected file on the backend to save the url to database. When I enter the ID of the control VS recognizes it but intellisense doesn't provide any clues as possible options.
Can anyone tell me how to fix the above error and also if possible, point me towards a overview/tutorial for this control. Have done a fair amount of Googling but not found anything.
Well, to start, you probably need to add an assembly reference to DotNetNuke.Web to your project. Once that's there, it'll probably help with your lack of intellisense as well.
Looks like the main way you interact with the selected URL is via the FileID property. The control itself will manage saving the file to the selected FolderPath (which may or may not be something the user can change).
But, you're right, there aren't good resources for how to use the control. The best "tutorial" it probably looking through the DotNetNuke core code to see how the core uses the control.
The built in dnn upload control is specifically designed for uploading files to the dnn file system - but to be honest its pretty ugly to work with.
It makes a lot of assumptions about what you want to do with the file and as part of its process automatically registers new file in the dnn file system index.
Its also not really ideal for thumbnail uploads or any such fancy stuff - since it has no capability for file size management or scaling and cropping - its something that has been promised a couple of times but not eventuated to date.
On top of this is has a bit of a mind of its own when it comes to where it actually stores the uploaded file - which means you may be better off looking at a 3rd party uploader that you can control more easily.
FWIW - there is a full version of the telerik asyn upload library installed with every dnn install - you will need to setup it up manually but that is not that hard.
<dnn:DnnAsyncUpload></dnn:DnnAsyncUpload> is the markup basic structure and its functionally equivalent to <telerik:RadAsyncUpload></telerik:RadAsyncUpload>
Its documented here http://www.telerik.com/help/aspnet-ajax/asyncupload-overview.html
Having said all this if you do want to stick with dnn file picker - this code will let you find the file object that dnn uploaded the file too.
String thisURL = "";
String thisPHYSICAL = "";
Int32 itest001 = thisControl001.FileID;
if ( itest001 > 0 )
{
var thisFILE = (DotNetNuke.Services.FileSystem.FileInfo)FileManager.Instance.GetFile(itest001);
thisURL = FileManager.Instance.GetUrl(thisFILE );
thisPHYSICAL = thisURL.PhysicalPath;
}
thisURL will contain a url relative to your website domain
thisPHYSICAL will contain the physical location of the file on your server.

Delphi - Want an automated way of maintaining the link between a "source" image file and images in my project

One thing I find Delphi doesn't manage well is the link between image "source" files and the image components in my project (D2006 here but I'm assuming it applies to all versions).
Say I have various static images in my project - backgrounds, toolbar button glyphs, various bits of eye candy, etc. I have a corresponding collection of PNG/BMP etc. files that I have sourced, scraped or created, and these have been loaded into the image components at design time.
One problem is that there seems to be no automated way of finding out three months later what source image file was used to load an image component. This becomes more of an issue when you need to edit one or more images.
So what I would really like, is some way of including the image source files in a build of a project. I.e. when I did a build, all of the image components would be reloaded from the sources first. At present, when I modify some of my images with PhotoShop or similar, I'm faced with a lengthy and error-prone process to reload the altered images into their respective image containers.
Is creating a resource with all of the images bound into it and adding code to load the image components at startup a viable way to go? Do others have this problem, and how do you manage it?
None of the standard components support what you are asking for. However, Thany's TPngImageList component does support the ability to associate a user-defined string with each image in the list.
Otherwise, to know which file belongs with which image, I would suggest using an .rc file to compile the external image files into the app's resources at compile-time, and then you can load the image resources into your components dynamically at run-time instead of at design-time. That way, you can manage the image files however you want. When you change a file, it will automatically be linked into the app on the next compile.
You might load the same images in runtime, and add these images in version control to ease maintenance. There are also command line tools for Lazarus (I guess you might find similar for Delphi too) which can put files into resources that you app can later use.
I load the images from ico files, populate a imagelist and then use it in my Virtual string tree for various nodes. Easy to change the ico files.
/Mikael

Why is Configuration message appearing on jpeg images exported from DICOM file?

I am trying to make a web based dicom image viewer. I am using c# and asp.net. I am using Clear Canvas libraries found on www.clearcanvas.ca. The problem here is that when I try to export the jpeg images from dicom files the following message appears on them:
"The current configuration system does not support user-scoped setting"
On other forums I have found that this error can be removed by the application scope settings. I have tried that and still the message appears on the images. I have even shifted the user settings in app.config file to applicationsettings sections. Since web based solutions do not support user settings because the website has to run on the server. If some one has done this and removed this message from the images, then please share it here. I would really appreciate some help on removing this error. Thanks.
The ClearCanvas ImageViewer components were written to using several User settings. IIS based applications do not support user settings. An exception is occurring within the assembly due to the lack of support for user settings and placing it on the image.
There's a couple of solutions. You could go and modify the code by changing all of the settings to be application settings instead of user settings. You could also create a new .NET settings provider that supports user settings that could be used within IIS.

Resources