Upload File - Code - Help
Hello everyone,
I hv put lot of effort doing in JS but seems like it will be more fexiable to do it in JSP. After see this example in php.
http://examples.codecharge.com/CCSExamplePack2/FileUpload/FileUpload.php
Click on "Attach relevant documents" in the above link you'll get idea what I wantted. Its something like this...
============================
Name: [ .....]
Email: [ ......]
File: [ ......] {browse} {Add}
List of Files
File Name Delete
xyz delete
abc delete
[submit button] [cancel button]
====================================
Upon "Add" the page may refresh or we can hv seperate windows just for upload file section like in the above link example.
Upload file can be more then one.
Basic Idea is before the submit user should see the file names which he/she submiting along with other form fields.
Regards
Yup. it can easily be done in JSP.
what's the problem you encountered?
Similar Messages
-
DW CS3 conflict with server & uploading files (please help?!?!)
I work with one other person and although we work on files locally, when one of us tries to push a file up to the remote server we get an error that reads:
"name of person" is currently working on that file (Please enable Check In/Out in the Site Definiteion dialog box to avoid overwirting changes made by otehr users.) Do you want to upload the file anyway?
Neither one of us has enabled Check in Check out feature either. My question is that I know this person isn't even in Dreamweaver or connected to the server. Two strange things:
1) Dreamweaver gives the actual person who is trying to upload the error saying that they are currently working on the file.
2) Dreamweaver actually gives me that error message but it's telling me that someone who left the office over two years ago and who I know no longer has an account on the server. How can she currently be working on a file or even linked to that file name???
We thought this glitch would go away when we got new PCs and loaded CS3 but it hasn't. Does anyone have any suggestions to help me figure out why we keep getting these issues.
THANKS!!!That's a server side issue. Either its timeouts are set way too liberally (to the server, your FTP connections never seem to end) or it creates a new session for every time you log on. Both are fundamentally wrong and from your description I get the impression that the machine is also otherwise not being maintained properly. Time to fly in the admin, I'd say.
Mylenium -
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 -
Right-clicking on the link doesn't offer options to open anywhere (new tab, etc.)
There is a problem with uploading files to Google docs in Firefox 3.6x versions.
http://www.google.com/support/forum/p/Google+Docs/thread?tid=4f0369bdcf6fd7ff&hl=en "Select files to upload" not working in Firefox - Google Docs Help (Thanks to Joolsa for the link) -
Error occurred when uploading file (unknown file format) in t.code SFP
Hi,
According to SAP Note 1465628 - ESI Limit increased and length of temp. ESI no increased, when we are doing Step 4. PDF form changes (valid for ECC 6.0 and above)....and point (i)...in transaction SFP (From - HR_IN_ESI_005_99), system shows the below message.
Error occurred when uploading file (unknown file format)
Message no. FPUIFB068
Plz guide..Hi Anil,
Refer following links :
Re: Adobe Form assignment
Adobe Uploading form error unknown file forma
Hope this will help.
Regards,
Vivek -
Help with uploading files through form
Hey,
I have a website for a sign business and I'm trying to make
it so people can upload custom artwork. I am using an ASP Formmail
script from I think it's www.brainjar.com. If I understood
correctly from the directions, I can't upload files through that
script and I tried it once and it did not work. If anyone has any
ideas then please help. Thanks
JeremyFor security reasons many shared hosts don't permit file
uploads.
Try this in the interim
http://www.yousendit.com/
--Nancy
"dayencom" <[email protected]> wrote in
message
news:epo2ql$dsb$[email protected]..
> I just tried contacting my hosting provider:
www.ixwebhosting.com and the
guy
> was not helpful at all. He said that their hosting does
not support
uploading
> files. So I am drawing a blank now. Is there any way to
use maybe another
site
> to upload?
> -
Error when uploading file : Return code = 6 in LSMW
Hello All,
Getting the bleow mentioned error in LSMW.
Error when uploading file Return code = 6 )
Is it related to access. please suggest.did you define the file in step 7 without any error and allocate in step 8 without any error before?
I mean in the same system where you execute the read step.
Make sure you have the file not open when you execute the read step. -
LSMW: "Error in Uploading File" error code 6
Hi All,
I have created a simple LSMW project for deletion of Purchase Requisition in Development server. It is working as per the requirement there. But when I tried to Export the project and import it into our Production Server, system gives "Error in Uploading file".
Hence, I recreated the project in Production system. Here again when I reached the step "Read Data" the same error occured. I wanted system to read the Purchase requisition numbers from a text file which i have already mapped in the steps previous to " Read Data".
Also, system says "Error Code 6"
Can anyone please highlight possible causes of this error message?
Regards,
Vishal DataHi,
first you have to check TEXT file data - why because you are tested in Development server with test data , but that same test date not available in Production server na
prepare PR numbers from Production server -convert into Txt. format
while running LSMW - close all Excel file and Text file ,
at the time of Import and Export - system will start Specify Files- item - that time you will give Production data Text file then Upload
I think now you can't face any error
Mahesh -
Help me with uploading files to jobsites
Someone help me, help me please. It seems that from my administrative account I can not upload files to any potential job sites. From any web site, the option that says, 'choose files' whenever I clique on that and try to upload the little multi-color turning circle comes on and everything freezes. However I am able to upload from my other user accounts but a lot of good that does because I do not have any saved information on those accounts. What is going with my computer, its the first time I have ever had an issue with my computer, did I catch a bug or something?
Have you successfully uploaded to this site before?
Is your site definition configured to upload to the proper
remote folder?
The error message is simply telling you the transfer did not
succeed
"mikesilverman22" <[email protected]> wrote
in message
news:e5im76$r17$[email protected]..
>I am trying to upload files onto a remote site, but it
keeps timing out.
>Also,
> on my new website that i'm making for a client, when i
Put the files onto
> the
> remote site it says Started:
>
> 5/30/06 7:57 PM
>
> index.html - error occurred - An FTP error occurred -
cannot put
> index.html.
> Access Denied. The file may not exist, or there could be
a permission
> problem.
>
> File activity incomplete. 1 file(s) or folder(s) were
not completed.
>
> Files with errors: 1
> index.html
>
> Finished: 5/30/06 7:57 PM
>
> What does this mean? why are the file incomplete?
>
> Mike S
> -
Error when uploading file :( Return code = 6 )
Hello All,
Getting the bleow mentioned error in LSMW.
Error when uploading file Return code = 6 )
Is it related to access. please suggest.Hi,
If the Sy-Subrc is 0 then Success,
Sy-SUBRC is 4 then failure,
Sy-SUBRC = 6 then the user might be not access to read the file.
This is due to authorization issue. -
Hi All,
Is there any way to upload Tariff Code (with multiple XML files) from application server?. Its urgent.
Regards,
JatinHi Jatin,
Yes, of course you can upload multiple files for tariff codes.
This can be done by the below path:-
SAP GTS Cockpit(tcode-/sapsll/menu_legal)-->Customs Management-->Classification-->Classification Master Data-->Upload Tariff Code Numbers from XML file(tocde- /SAPSLL/LLNS_UPL101).
In the above area after browsing and choosing the first file, please select multiple check box to choose more files as well. Then you can further select your application server and upload all those files in one go.
PS:- Although, we have an option to upload multiple such files but actually we should avoid multiple file uploads due to various reasons. Hence, please take utmost care during such procedure.
Regards,
Aman -
Help: How can I implement upload file in UIX ...
without interMedia option.
Can anybody help me?
Thanks!Attila -
Assuming you are using uiXML - check out the "Multipart requests" section in the JavaDoc for the oracle.cabo.servlet.AbstractPageBroker. The gist of it is that you'll want to create an extension of UIXPageBroker which overrides doUploadFile() and uses the MultipartFormItem API to get at the contents of the uploaded file.
If you are using UIX JSP, you can use the oracle.cabo.share.util.MutlipartFormHandler to explicitly process your multipart requests.
And of course, you'll want to include a fileUpload component in your UIX document - and be sure to set the "usesUpload" attribute of your UIX form to true.
Andy -
Business Catalyst Help | Upload files to the site
This question was posted in response to the following article: http://helpx.adobe.com/business-catalyst/sbo/upload-files-using-file-manager.html
Hi Kevin,
I assume that you have created your site through Muse. In this case, by default, File Manager is disabled to prevent the risk of accidental content overwrites since there is no roundtrip between Muse and the online editor.
If you wish to enable the File Manager, edit your account settings (by clicking on your name on the top right corner and selecting My Details) and check the Enable online content editing box.
This will enable several options into your menu, including the file manager.
Cristinel -
Help with uploading files to remote site
I am trying to upload files onto a remote site, but it keeps
timing out. Also, on my new website that i'm making for a client,
when i Put the files onto the remote site it says Started:
5/30/06 7:57 PM
index.html - error occurred - An FTP error occurred - cannot
put index.html. Access Denied. The file may not exist, or there
could be a permission problem.
File activity incomplete. 1 file(s) or folder(s) were not
completed.
Files with errors: 1
index.html
Finished: 5/30/06 7:57 PM
What does this mean? why are the file incomplete?
Mike SHave you successfully uploaded to this site before?
Is your site definition configured to upload to the proper
remote folder?
The error message is simply telling you the transfer did not
succeed
"mikesilverman22" <[email protected]> wrote
in message
news:e5im76$r17$[email protected]..
>I am trying to upload files onto a remote site, but it
keeps timing out.
>Also,
> on my new website that i'm making for a client, when i
Put the files onto
> the
> remote site it says Started:
>
> 5/30/06 7:57 PM
>
> index.html - error occurred - An FTP error occurred -
cannot put
> index.html.
> Access Denied. The file may not exist, or there could be
a permission
> problem.
>
> File activity incomplete. 1 file(s) or folder(s) were
not completed.
>
> Files with errors: 1
> index.html
>
> Finished: 5/30/06 7:57 PM
>
> What does this mean? why are the file incomplete?
>
> Mike S
> -
How to upload file from a client machine to server machine
hei evryone!
can anyone pls help me on how i can upload file from a client machine to another machine (or server). using jsp.Then later on, i can also retrieve the names of these files to place it as values for option tag in an html form.I have a seperate screen for uploading the file and the screen for displaying all the files that were uploaded on the server...
any sample code/ ideas would be much appreciated.Thx!!!!hei evryone!
can anyone pls help me on how i can upload file from a client machine to another machine (or server). using jsp.Then later on, i can also retrieve the names of these files to place it as values for option tag in an html form.I have a seperate screen for uploading the file and the screen for displaying all the files that were uploaded on the server...
any sample code/ ideas would be much appreciated.Thx!!!!
Maybe you are looking for
-
Yet another "AdfFacesFilter has not been installed" problem
Hi, I'm getting the following warning: WARNING: The AdfFacesFilter has not been installed. ADF Faces requires this filter for proper execution. I've read a bunch of threads on this warning but none of them helped me resolve the warning in my case and
-
Logic Express and Garritan Personal Orchestra
Hi. Please can somebody explain (simply!) how to access Garritan sounds in Logic Express 8. Many Thanks Nick
-
Bind variable code takes more time to complete?
Hello, My database is oracle11g. I have same plsql code and first one is without bind variable and second one is with bind variable. Usually, bind variable should take less time. But here the bind variable takes more time than the regular code... Can
-
Someone's Q10 wouldn't come up. Thinking it's a battery issue, on getting home he put on a spare battery. It still wont come on. Hours later its still not coming on. He tried reloading the software using BB Link without success. The solution was to l
-
Finder Context Menu - Remove Blue Harvest?
I had a trial version of Blue Harvest to clean ds_store files that removed but its "Clean Using Blue Harvest..." finder context menu item still displays. How do i delete this? TIA, EB Message was edited by: EarthBased