Attributes...Help with displaying File Type Icons
I have a document area folder(s) that content managers can
upload files into. I know that they can place an image with
these files by using the secondary tab, BUT, my question is
this....
Is there a way to have the portal identify what type of file
this is and associate an image to it to display just like
the "NEW" icon does....ie....when they load a word document, the
word icon will be displayed next to the title.
This would get rid of having to upload the image with every file
(Which there are many) and save space within the database as
these images are stored with in each record.
Please let me know if this is possible and if anyone has any
suggestions.
PS...running 308 at this time.
OK...I figured it out a couple different ways.
First way I did it was to create perspectives for each file type
ie word, excel Power Point etc. You can then just add the
perspective when adding files to the document area.
BUT, this also isn't automated and can be if you want to.
Simply write a trigger(s) to do this for you. Wrote one this
afternoon and it work flawlessly. Now when users add a file to
the document area, a nice little ICON displays next to the file
name.
If anyone else has a different more efficient way, please pass
it on.
Thanks
Similar Messages
-
PDF File Type Icon Not Displaying HELP!!!
Hey guys!
I have a quick question that I need resolved. Make sure you READ before you respond as people seem to be having trouble with this one.
Something happened on my system to where .pdf files aren't displaying the PDF file type image anymore. They're just displaying the Windows default non-associated file icon.
But the weird thing is that the .pdf file type IS associated with Adobe Acrobat, and when double clicked they DO open in Acrobat.
I checked inside of Acorbat.dll and the file type icon IS in there...so this is leading me to believe that something is messed up in the registry to where Windows doesn't know to link a .pdf with the icon inside of Acrobat.dll.
So my question is this...how do I RELINK the .pdf file type with the PDF file type icon located inside of Acrobat.dll???Before you start editing the registry try the suggestions given in the FAQ:
http://www.adobeforums.com/webx/.3bbc2da9
failing that try doing a repair of acrobat from the help menu.
If still no joy let us know. -
Problem with import file type setting
Problem with import file type settings - In preferences>general I select "wav encoder" But then going to tools>Create it still says "create mp3 version".
Can't find a way to overcome this. Thanks for any help.Doublechecking, roy. After making the preferences change, are you leaving the General tab by clicking the OK button down the bottom-right-hand corner of the tab?
-
File type icons in CS6 Design and Web Premium
Hello everyone.
I am running Windows 7, 64 bit. I have recently upgraded from CS5.5 Design Premium to CS6 Design and Web Premium.
I the process, I lost the association of file types (such as .psd) with their relevant programs, which I have now recified.
However, the filetype icons that are associated with each program, in most cases, don't seem to have assigned themselves to their respecitive icons. For example, .psd files now show as a white document with the blue Ps square icon in the centre, and the same for InDesign etc. Oddly, Illustrator has worked and has assigned it's icons correctly.
For example:
I can't find a method of editing specific file types icons - even then, I wouldn't know where to find the particular icon sets.
Any ideas?
Thanks in advance either way.I used the CS Cleaner (http://www.adobe.com/support/contact/cscleanertool.html) and followed the steps its really easy.. but ur gonna have to re install you Creative Suite all u do for the cleaner is open it up then select english (e) ->enter->Agree (Y)->enter->All (1) (which is the first option for a full clean i guess)->enter->Product Number its just basically asking you to input your choice number again (1)->enter and should tell u its all done then after u install CS again go to start-> default programs->associate file type->.psd for example->double click it and select Photoshop even though its probably already selected >.< but just do it again cuz it will refresh all the files on the coputer and whala you should c the correct file dysplay Heres pictures of my files before and after as proof
-
how get File Type Icon Image (Windows )
FileSystemView.getSystemIcon( File );works in swing application, can not be used for javafx.scene.image.ImageView;Hmm, good question.
Looking at the FileChooser, it looks like the native chooser is used so possibly the JFX guys didn't have to expose access to the icons to make it work. You might want someone to confirm, but my guess is there is no equivalent yet in JFX.
Assuming there's nothing, you could try the hacks in here to convert the image: Image conversion between AWT and FX
Failing that you're probably looking at raising a JIRA feature request to get it in a future release.
Cheers,
zonski
Did you find this answer useful? If so, please mark as 'Correct' or 'Helpful'. -
Missing or wrong file type icons
Got my new Retina iMac this week (running OS X 10.10 of course) and went through and downloaded/installed all my lovely programs but now some of the file type icons are showing up as awful exec type file icons (see below).
All the .indd files were created in the same version Adobe InDesign CC 2014 and InDesign is set as the default program for all these file types, but as you will be able to see, some have that awful black icon. Blergh!
Any suggestions?Please read this whole message before doing anything.
This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
Test while in safe mode. Same problem?
After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test. -
Hi,
I using FileSystemView to get file type icon. But the icon dimension i am getting is either 16x16 or 32x32.
Can any one tell me, how to get bigger icons like windows vista have large icons view. upto 256x256Mayby this code can help:
FileSystemView view = FileSystemView.getFileSystemView();
ShellFolder shellFolder = ShellFolder.getShellFolder(new File("xx.gif"));
import java.io.File;
import java.io.IOException;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.BoxLayout;
import javax.swing.filechooser.FileSystemView;
import sun.awt.shell.ShellFolder;
public class FileIconExtractor extends JFrame implements ActionListener{
private JButton getIconBtn = new JButton("get Icon");
private JPanel iconPanel = new JPanel();
private JTextField extField = new JTextField();
private JLabel smallIconLabel = new JLabel("small Icon here");
private JLabel bigIconLabel = new JLabel("big Icon here");
public FileIconExtractor() {
this.setSize(200, 150);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new BorderLayout());
getIconBtn.setActionCommand("GETICON");
getIconBtn.addActionListener(this);
iconPanel.setLayout(new BoxLayout(iconPanel, BoxLayout.Y_AXIS));
iconPanel.add(smallIconLabel);
iconPanel.add(bigIconLabel);
this.add(extField, BorderLayout.NORTH);
this.add(iconPanel, BorderLayout.CENTER);
this.add(getIconBtn, BorderLayout.SOUTH);
this.setVisible(true);
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("GETICON")) {
String ext = extField.getText();
File file;
try
file = File.createTempFile("icon", "." + ext);
FileSystemView view = FileSystemView.getFileSystemView();
Icon smallIcon = view.getSystemIcon(file);
ShellFolder shellFolder = ShellFolder.getShellFolder(file);
Icon bigIcon = new ImageIcon(shellFolder.getIcon(true));
setIconLabel(smallIcon, bigIcon);
file.delete();
catch (IOException ioe)
ioe.printStackTrace();
private void setIconLabel(Icon smallIcon, Icon bigIcon) {
smallIconLabel.setIcon(smallIcon);
bigIconLabel.setIcon(bigIcon);
public static void main(String[] args) {
FileIconExtractor fie = new FileIconExtractor();
} -
Can some help with CR2 files ,Ican`t see CR2 files in adobe bridge
can some help with CR2 files ,I can`t see CR2 files in adobe bridge when I open Adobe Photoshop cs5- help- about plugins- no camera raw plugins. When i go Edit- preference and click on camera raw shows message that Adobe camera raw plugin cannot be found
That's strage. Seems that the Camera Raw.8bi file has been moved to different location or has gone corrupt. By any chance did you try to move the camera raw plugin to a custom location?
Go To "C:\Program Files (x86)\Common Files\Adobe\Plug-Ins\CS5\File Formats" and look for Camera Raw.8bi file.
If you have that file there, try to download the updated camera raw plugin from the below location.
http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5371&fileID=5001
In case you ae not able to locate the Camera Raw.8bi file on the above location, then i think you need to re-install PS CS5.
[Moving the discussion to Photoshop General Discussions Forum] -
Help with add file name problem with Photoshop CS4
Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
Script follows:
// this script is another variation of the script addTimeStamp.js that is installed with PS7
//Check if a document is open
if ( documents.length > 0 )
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.INCHES;
try
var docRef = activeDocument;
// Create a text layer at the front
var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.TEXT;
myLayerRef.name = "Filename";
var myTextRef = myLayerRef.textItem;
//Set your parameters below this line
//If you wish to show the file extension, change the n to y in the line below, if not use n.
var ShowExtension = "n";
// Insert any text to appear before the filename, such as your name and copyright info between the quotes.
//If you do not want extra text, delete between the quotes (but leave the quotes in).
var TextBefore = "Lower© ";
// Insert any text to appear after the filename between the quotes.
//If you do not want extra text, delete between the quotes (but leave the quotes in).
var TextAfter = " ";
// Set font size in Points
myTextRef.size = 10;
//Set font - use GetFontName.jsx to get exact name
myTextRef.font = "Arial";
//Set text colour in RGB values
var newColor = new SolidColor();
newColor.rgb.red = 0;
newColor.rgb.green = 0;
newColor.rgb.blue = 0;
myTextRef.color = newColor;
// Set the position of the text - percentages from left first, then from top.
myTextRef.position = new Array( 10, 99);
// Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
myLayerRef.blendMode = BlendMode.NORMAL;
// select opacity in percentage
myLayerRef.opacity = 100;
// The following code strips the extension and writes tha text layer. fname = file name only
di=(docRef.name).indexOf(".");
fname = (docRef.name).substr(0, di);
//use extension if set
if ( ShowExtension == "y" )
fname = docRef.name
myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
catch( e )
// An error occurred. Restore ruler units, then propagate the error back
// to the user
preferences.rulerUnits = originalRulerUnits;
throw e;
// Everything went Ok. Restore ruler units
preferences.rulerUnits = originalRulerUnits;
else
alert( "You must have a document open to add the filename!" );you might want to try the scripting forum howard:
http://www.adobeforums.com/webx?13@@.ef7f2cb -
How do you display file type in PS Elements 10?
How do you display file type in PS Elements 10 in the Organizer for each photo?
I know you can right click and look at meta data.
In PSE 7 it was displayed under each photo.Two things:
1. Set the View option to show file names:
2. Ensure your thumbnails are large enough to display the data:
Ken -
How to get File type icon for files store on Amazons3
Hi,
i want to know about how to get file type icons for files that we store on Amazons3.i am a devloper ,i want to make gui for accessing amazons3.
so ,i want to know about how to get file type icons for files that we store on Amazons3.
thanx in advance.hi,
have u heard amazon simple storage service,that provides storage space for
storing files, i am a devloper,i want to know the files that we store on amazon,how we can get file type icon for that files.
i want to sample code in java for this.
thanx in advance. -
Testing for applications associated with a file type
Dear contributors,
while trying to open a simple *.txt file via java.awt.Desktop.open(File)
the IOException is thrown. According to Javadoc there is "no associated
application or the associated application fails to be launched" in this
case. Interestingly the Desktop class does not provide methods to test
for particular file type registration, just for the "support" of a generic
Desctop.Action. Colud you please illuminate how to check, whether a file
extension / file type / mime type has an associated application in a platform
(in)dependent way at least for "opening" ?
OS: Linux, 2.6.24-22-generic, x86_64
JDK: 1.6.0_07, 64 bit
Many thanks
Jaro PullmannIf you make the call and an exception is thrown, then there is not application associated with the file type--otherwise I believe you need to do some registry work if you do not want a pretest.
-
Firefox will not save my "Always do this with this file type" preference.
Alright, bear with me because I am extremely new to Firefox. Anyway, when I download a .torrent file for uTorrent, it asks me the obligatory "What to do with this file type" question. Great. But when I checked to be sure it was opening uTorrent (Yes.) and ticked the "Always do this for this file type" box. Then, I clicked "OK". Awesome.
Then, after that, when I try to download a .torrent file it asks the same question again. Click click. and again. click click. and again......you get the picture. Why wont it remember this preference?Sites override the "Always do this" preference by serving files with a special HTTP header known as '''Content-disposition: Attachment'''
You can look for this happening by installing the [https://addons.mozilla.org/en-US/firefox/addon/3829 Live HTTP Headers] extension then accessing it from the '''Tools''' menu just before clicking a .torrent link to monitor the headers sent. -
Help with selecting files from script menu or drag and drop
I found this scale images applescript online. It works great when a bunch of files is dragged on top of the script but I would like it to also work when a folder or group of files is selected in the Finder and I activate it from the scripts menu.
I can't get my on run statement to work. I'm not really an Applescript guy so I'm really just asking if someone can help finish what I started in this on run.
-- save in Script Editor as Application
-- drag files to its icon in Finder
property target_width : 120
property save_folder : ""
on run
tell application "Finder"
activate
set folder_path to quoted form of (POSIX path of (the selection as alias))
set theItems to every file of folder_path
end tell
end run
on open some_items
-- do some set up
tell application "Finder"
-- get the target width, the default answer is the property target_width
set new_width to text returned of ¬
(display dialog "Target width:" default answer target_width ¬
buttons {"OK"} default button "OK")
if new_width as integer > 0 then
set target_width to new_width
end if
-- if the save_folder property has not been set,
-- set it to the folder containing the original image
if save_folder is "" then
set save_folder to ¬
(container of file (item 1 of some_items) as string)
end if
-- get the folder to save the scaled images in,
-- default folder is the property save_folder
set temp_folder to ¬
choose folder with prompt ¬
"Save scaled images in:" default location alias save_folder
set save_folder to temp_folder as string
end tell
-- loop through the images, scale them and save them
repeat with this_item in some_items
try
rescaleand_save(thisitem)
end try
end repeat
tell application "Image Events" to quit
end open
on rescaleand_save(thisitem)
tell application "Finder"
set new_item to save_folder & "scaled." & (name of this_item)
end tell
tell application "Image Events"
launch
-- open the image file
set this_image to open this_item
set typ to this_image's file type
copy dimensions of this_image to {current_width, current_height}
scale this_image by factor (target_width / current_width)
save this_image in new_item as typ
end tell
end rescaleandsaveWhen items are dragged to your script's icon they are passed in to the on open handler, so this triggers:
on open some_items
and the dragged items are passed in as some_items
In contrast, when you double-click on the script, or invoke it via the Script menu, this runs the on run handler:
on run
tell application "Finder"
activate
folder_path to quoted form of (POSIX path of (the selection as alias))
set theItems to every file of folder_path
end tell
end run
However, there's nothing in this block that actually does anything with the selection - you (dangerously) assume that the selection is a folder (you really should check first), and just set theItems to every file in that folder then you exit.
So to do what you want you'll need to edit your run handler to filter the selection and pass files over to the code that does the hard work.
You already have the basis for this - your rescaleandsave() handler, so it's just a matter of identifying the files in the selection and passing those over to that handler:
on run
tell application "Finder"
set cur_selection to (get selection) -- get the selection
repeat with each_item in cur_selection -- iterate through
if class of each_item is folder then -- do we have a folder?
set theFiles to every file of each_item -- if so, get its contents
repeat with each_file in theFiles -- iterate through them
my rescaleand_save(eachfile) -- and process them
end repeat
else if class of each_item is document file then -- do we have a file selected?
my rescaleand_save(eachitem) -- if so, process it
end if
end repeat
end tell
end run
So the idea here is that the run handler gets the selection and works through the (potentially-numerous) items. For each selected item it checks whether its a folder or a file, if its a folder it gets all the files within and passes them to the rescaleandsave handler.
Note that this is not recursive - it won't catch files within folders within folders - since it only looks at the top level of selected folders, but it wouldn't be hard to rework the script to handle that if that's what you need. -
Help with Upload file to Server Examples
I have been working with the examples for how to upload a file to the server. Though i got the example to work. there is one more thing i need to do. i need to allow the user to be able to select multiple files. In the example when you click on Upload, it opens a MS window to allow you to select a file. This example does not allow you to select more then one file though. I found another example for selecting multiple files but this one differs very much in that the person who make it "Ryan Favro" created a whole new GUI window to select multiple files. those his example works great, i dont want a special window to select files, i want the MS window to do it.
Is there a way to make the original example that uses the MS window to allow the user to select multiple files ?
I have attached the example that uses the MS window.Hi,
Use this code. May be it helps u.
fileuploadapp.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:com="test.*" layout="absolute"
creationComplete="initApp()" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private const _strDomain:String = new String("http://localhost:8400/");
private const _strUploadScript:String = new String(_strDomain + "ProcessFileUp/UploadFile");
// Initalize
private function initApp():void {
Security.allowDomain(_strDomain);
]]>
</mx:Script>
<mx:Canvas width="400" height="300" horizontalCenter="0" verticalCenter="0">
<com:FileUpload
width="100%" height="100%"
uploadUrl="{_strUploadScript}"
uploadComplete="Alert.show('File(s) have been uploaded.', 'Upload successful')"
uploadIOError="Alert.show('IO Error in uploading file.', 'Error')"
uploadSecurityError="Alert.show('Security Error in uploading file.', 'Error')"/>
</mx:Canvas>
</mx:Application>
fileuoload.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:com="*"
layout="vertical" width="100%" minWidth="400" height="100%" minHeight="200"
title="Upload Files" creationComplete="initCom()">
<mx:Metadata>
[Event(name="uploadComplete", type="flash.events.Event")]
[Event(name="uploadProgress", type="flash.events.ProgressEvent")]
[Event(name="uploadCancel", type="flash.events.Event")]
[Event(name="uploadIOError", type="flash.events.IOErrorEvent")]
[Event(name="uploadSecurityError", type="flash.events.SecurityErrorEvent")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import mx.controls.*;
import mx.managers.*;
import mx.events.*;
import flash.events.*;
import flash.net.*;
private var _strUploadUrl:String;
private var _refAddFiles:FileReferenceList;
private var _refUploadFile:FileReference;
private var _arrUploadFiles:Array;
private var _numCurrentUpload:Number = 0;
// Set uploadUrl
public function set uploadUrl(strUploadUrl:String):void {
_strUploadUrl = strUploadUrl;
// Initalize
private function initCom():void {
_arrUploadFiles = new Array();
enableUI();
uploadCheck();
// Called to add file(s) for upload
private function addFiles():void {
_refAddFiles = new FileReferenceList();
_refAddFiles.addEventListener(Event.SELECT, onSelectFile);
_refAddFiles.browse();
// Called when a file is selected
private function onSelectFile(event:Event):void {
var arrFoundList:Array = new Array();
// Get list of files from fileList, make list of files already on upload list
for (var i:Number = 0; i < _arrUploadFiles.length; i++) {
for (var j:Number = 0; j < _refAddFiles.fileList.length; j++) {
if (_arrUploadFiles[i].name == _refAddFiles.fileList[j].name) {
arrFoundList.push(_refAddFiles.fileList[j].name);
_refAddFiles.fileList.splice(j, 1);
j--;
if (_refAddFiles.fileList.length >= 1) {
for (var k:Number = 0; k < _refAddFiles.fileList.length; k++) {
_arrUploadFiles.push({
name:_refAddFiles.fileList[k].name,
size:formatFileSize(_refAddFiles.fileList[k].size),
file:_refAddFiles.fileList[k]});
listFiles.dataProvider = _arrUploadFiles;
listFiles.selectedIndex = _arrUploadFiles.length - 1;
if (arrFoundList.length >= 1) {
Alert.show("The file(s): \n\n• " + arrFoundList.join("\n• ") + "\n\n...are already on the upload list. Please change the filename(s) or pick a different file.", "File(s) already on list");
updateProgBar();
scrollFiles();
uploadCheck();
// Called to format number to file size
private function formatFileSize(numSize:Number):String {
var strReturn:String;
numSize = Number(numSize / 1000);
strReturn = String(numSize.toFixed(1) + " KB");
if (numSize > 1000) {
numSize = numSize / 1000;
strReturn = String(numSize.toFixed(1) + " MB");
if (numSize > 1000) {
numSize = numSize / 1000;
strReturn = String(numSize.toFixed(1) + " GB");
return strReturn;
// Called to remove selected file(s) for upload
private function removeFiles():void {
var arrSelected:Array = listFiles.selectedIndices;
if (arrSelected.length >= 1) {
for (var i:Number = 0; i < arrSelected.length; i++) {
_arrUploadFiles[Number(arrSelected[i])] = null;
for (var j:Number = 0; j < _arrUploadFiles.length; j++) {
if (_arrUploadFiles[j] == null) {
_arrUploadFiles.splice(j, 1);
j--;
listFiles.dataProvider = _arrUploadFiles;
listFiles.selectedIndex = 0;
updateProgBar();
scrollFiles();
uploadCheck();
// Called to check if there is at least one file to upload
private function uploadCheck():void {
if (_arrUploadFiles.length == 0) {
btnUpload.enabled = false;
listFiles.verticalScrollPolicy = "off";
} else {
btnUpload.enabled = true;
listFiles.verticalScrollPolicy = "on";
// Disable UI control
private function disableUI():void {
btnAdd.enabled = false;
btnRemove.enabled = false;
btnUpload.enabled = false;
btnCancel.enabled = true;
listFiles.enabled = false;
listFiles.verticalScrollPolicy = "off";
// Enable UI control
private function enableUI():void {
btnAdd.enabled = true;
btnRemove.enabled = true;
btnUpload.enabled = true;
btnCancel.enabled = false;
listFiles.enabled = true;
listFiles.verticalScrollPolicy = "on";
// Scroll listFiles to selected row
private function scrollFiles():void {
listFiles.verticalScrollPosition = listFiles.selectedIndex;
listFiles.validateNow();
// Called to upload file based on current upload number
private function startUpload():void {
if (_arrUploadFiles.length > 0) {
disableUI();
listFiles.selectedIndex = _numCurrentUpload;
scrollFiles();
// Variables to send along with upload
var sendVars:URLVariables = new URLVariables();
sendVars.action = "upload";
var request:URLRequest = new URLRequest();
request.data = sendVars;
request.url = _strUploadUrl;
request.method = URLRequestMethod.POST;
_refUploadFile = new FileReference();
_refUploadFile = listFiles.selectedItem.file;
_refUploadFile.addEventListener(ProgressEvent.PROGRESS, onUploadProgress);
_refUploadFile.addEventListener(Event.COMPLETE, onUploadComplete);
_refUploadFile.addEventListener(IOErrorEvent.IO_ERROR, onUploadIoError);
_refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onUploadSecurityError);
_refUploadFile.upload(request, "file", false);
// Cancel and clear eventlisteners on last upload
private function clearUpload():void {
_refUploadFile.removeEventListener(ProgressEvent.PROGRESS, onUploadProgress);
_refUploadFile.removeEventListener(Event.COMPLETE, onUploadComplete);
_refUploadFile.removeEventListener(IOErrorEvent.IO_ERROR, onUploadIoError);
_refUploadFile.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onUploadSecurityError);
_refUploadFile.cancel();
_numCurrentUpload = 0;
updateProgBar();
enableUI();
// Called on upload cancel
private function onUploadCanceled():void {
clearUpload();
dispatchEvent(new Event("uploadCancel"));
// Get upload progress
private function onUploadProgress(event:ProgressEvent):void {
var numPerc:Number = Math.round((event.bytesLoaded / event.bytesTotal) * 100);
updateProgBar(numPerc);
var evt:ProgressEvent = new ProgressEvent("uploadProgress", false, false, event.bytesLoaded, event.bytesTotal);
dispatchEvent(evt);
// Update progBar
private function updateProgBar(numPerc:Number = 0):void {
var strLabel:String = (_numCurrentUpload + 1) + "/" + _arrUploadFiles.length;
strLabel = (_numCurrentUpload + 1 <= _arrUploadFiles.length && numPerc > 0 && numPerc < 100) ? numPerc + "% - " + strLabel : strLabel;
strLabel = (_numCurrentUpload + 1 == _arrUploadFiles.length && numPerc == 100) ? "Upload Complete - " + strLabel : strLabel;
strLabel = (_arrUploadFiles.length == 0) ? "" : strLabel;
progBar.label = strLabel;
progBar.setProgress(numPerc, 100);
progBar.validateNow();
// Called on upload complete
private function onUploadComplete(event:Event):void {
_numCurrentUpload++;
if (_numCurrentUpload < _arrUploadFiles.length) {
startUpload();
} else {
enableUI();
clearUpload();
dispatchEvent(new Event("uploadComplete"));
// Called on upload io error
private function onUploadIoError(event:IOErrorEvent):void {
clearUpload();
var evt:IOErrorEvent = new IOErrorEvent("uploadIoError", false, false, event.text);
dispatchEvent(evt);
// Called on upload security error
private function onUploadSecurityError(event:SecurityErrorEvent):void {
clearUpload();
var evt:SecurityErrorEvent = new SecurityErrorEvent("uploadSecurityError", false, false, event.text);
dispatchEvent(evt);
// Change view state
private function changeView():void {
currentState = (currentState == "mini") ? "" : "mini";
]]>
</mx:Script>
<mx:states>
<mx:State name="mini">
<mx:SetProperty name="height" value="60"/>
<mx:SetProperty name="minHeight" value="60"/>
<mx:SetStyle target="{btnView}" name="icon" value="@Embed('assets/application_put.png')"/>
</mx:State>
</mx:states>
<mx:transitions>
<mx:Transition fromState="*" toState="*">
<mx:Resize target="{this}" duration="1000"/>
</mx:Transition>
</mx:transitions>
<mx:Canvas width="100%" height="100%">
<mx:DataGrid id="listFiles" left="0" top="0" bottom="0" right="0"
allowMultipleSelection="true" verticalScrollPolicy="on"
draggableColumns="false" resizableColumns="false" sortableColumns="false">
<mx:columns>
<mx:DataGridColumn headerText="File" dataField="name" wordWrap="true"/>
<mx:DataGridColumn headerText="Size" dataField="size" width="75" textAlign="right"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
<mx:ControlBar horizontalAlign="center" verticalAlign="middle">
<mx:Button id="btnAdd" toolTip="Add file(s)" click="addFiles()" icon="@Embed('assets/add.png')" width="26"/>
<mx:Button id="btnRemove" toolTip="Remove file(s)" click="removeFiles()" icon="@Embed('assets/delete.png')" width="26"/>
<mx:ProgressBar id="progBar" mode="manual" label="" labelPlacement="center" width="100%"/>
<mx:Button id="btnCancel" toolTip="Cancel upload" icon="@Embed('assets/cancel2.png')" width="26" click="onUploadCanceled()"/>
<mx:Button label="Upload" toolTip="Upload file(s)" id="btnUpload" click="startUpload()" icon="@Embed('assets/bullet_go.png')"/>
<mx:Button id="btnView" toolTip="Show/Hide file(s)" icon="@Embed('assets/application_get.png')" width="26" click="changeView()"/>
</mx:ControlBar>
</mx:Panel>
Regards,
Shivang
Maybe you are looking for
-
Problems of MacPro 2010 Mixing 2gb & 1gb memory together
Actually my MacPro 2010 12-core was running 8x1gb sticks before. I just got 4 of 2gb sticks memory from a friend today. And I do have problem mixing them with the original 1gb sticks. Only plug 2gb sticks in Slot 1,2,5,6 - No Problem When I have 2 x
-
How many contacts can I text at a time using text messaging?
Before the upgrade to ios5 I could send 1 text message that included 20 contacts, now I can't seem to do more than 10 at a time. I coach a youth baseball team and it is very convenient to send one text to parents about practice/games. Now I have to
-
Using DW I created a simple flash slideshow. It works fine in test but when I move the page, photos and file to the production server, it does not show. The first time I tested it on the test server, a message came up and said it was installing som
-
Rendering of SWF Loader child SWFs
I am using the swf loader with an Xcelsius OpenDoc link (http://<server>:8080/Xcelsius/opendoc/documentDownload?sIDType=CUID&iDocID=<CUID>&sKind=Flash&CELogonToken=<CELogonToken>) and it works beautifully so long as the parent swf is also opened usi
-
I am unable to install Lightning calendar to Thunderbird 31.1.2/Windows 7 64bit
I am unable to install Lightning calendar to Thunderbird 32.0.3/Windows 7 64bit. My original calendar dissapeared a while ago during an update. I have tried downloading lightning-3.3.sm+tb-windows.xpi, but every time I try to run it, all it does is a