C# :: Uploading File From Flex To WCF REST Stream

Mar 24, 2011

The system is a Flex application communicating with a WCF REST web service. I am trying to upload a file from the Flex application to the server and am running into some issues. I'm using a FileReference in the Flex app to browse and upload the file as defined here: [URL]. I am then receiving the file as a Stream (shows as System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream in the debugger) in the WCF REST web service (using project type of WCF 4 REST Service)

[WebInvoke(Method = "POST", UriTemplate = "_test/upload")]
public void UploadImage(Stream data) {
// TODO: just hardcode filename for now
var filepath = HttpContext.Current.Server.MapPath(@"~\_testfile.txt");
using (Stream file = File.OpenWrite(filepath)){
[Code] .....

View 2 Replies


Similar Posts:


File Uploading Using Flex Only?

Jan 19, 2011

/Flex code/
private const UPLOAD_URL:String = "http://myhosting/upload/upload.php";
private var cer:FileFilter = new FileFilter("Archivos Cer", "*.cer");
private var key:FileFilter = new FileFilter("Archivos Key", "*.key");
private var fileref:FileReference = new FileReference();
private var fileref2:FileReference = new FileReference();

[Code]...

View 1 Replies

Osx :: Uploading A File On Mac Osx Using Adobe Flex 3?

Feb 10, 2010

I've created a fileUpload.mxml component in flex 3 which basically uploads m4a's to a designated server. The general code is below:

private var uploadURL:URLRequest;
private var file:FileReference;
file=new FileReference();[code].....

Everything works fine on a windows pc, but not on a mac pc. It stops at file. upload (uploadURL)(and thus doesn't trigger Event.COMPLETE).

View 1 Replies

Flex :: Get ByteArray Of File When Uploading?

Apr 12, 2011

There is a WSDL which have one method which take byteArray & fileName(which i want to write) as a parameter to write a file in local system, the following is the code...

public void writeLocation(byte[] byteToWrite, String fileName) throws FileNotFoundException
{
StringBuffer fileLocation = new StringBuffer("D:\Products\Device");

[Code]....

but the flex 2 showing the error when i searched i found out in flex 2 there is no "data" property. so i am unable to create the selected object into byteArray..

View 1 Replies

Flex :: Get Full Qualified Path Of Uploading File

May 28, 2011

say, user created a xml file by an AIR application and this file has been saved in certain location of his machine. If user enters second time in that application, the content of that XML file, should be displayed without prompting him. application should read file silently and display the content.In this scenario, i thought that when user will save that file, the entire file location will be saved in cookie. If user enters second time in that application, the file path will be available from cookie. user will not be prompted.[code]How can I get that full qualified path of saved file?

View 1 Replies

Flash :: File Stream In Flex Web App

Jul 25, 2011

I want to read a file that is in the client machine in flex web app.But ± dont want file to send server for processing ± want to to read content of file and show in it a component .

View 1 Replies

Professional :: Is Preloader Loading Rest Of File

Sep 15, 2010

How do I know that my preloader is loading the rest of my file?  I put a preloader on the first frame  The rest of my web site is on the second frame  If that takes too long to load up, I want the  preloader to load.  How do I know it is actually loading up the rest of the site?  Or, is that not what a preloader actually does?

View 3 Replies

Actionscript 3 :: Httpresponse - File Reference Response Data After Uploading A File

Aug 29, 2011

I have written a ac3 script to upload files to remote servers and it is working as expected with all the events.

From the server side script i am echoing some text according to the upload status and i want that status to be received in flash like response text in ajax.

Is it possible to receive response text from a server script after uploading a file.

Or it doesn't have to be a file upload yet i wanted to have the string echoed in the server side script as response text in flash.

If that is not possible like ajax or normal request and response then is there another ways of achieving that?

Here is the code which gets executed when upload is complete.

fr.addEventListener(Event.COMPLETE, function(e:Event): void
{
lblPer.text = 'Completed';

[Code].....

View 1 Replies

Wcf :: WCF REST Upload File (some Files Succeed - 200, Some Fail - 400 Bad Request)?

Apr 19, 2011

Here's my WCF REST endpoint:

[WebInvoke(Method = "POST", UriTemplate = "_test/upload")]
public void UploadImage(Stream data)
{[code].....

And I'm using the multipart parser from here: http://antscode.blogspot.com/2009/11/parsing-multipart-form-data-in-wcf.html.My issue is that the above works great for some files (.bat, .txt, .cs, .doc) - I see in Fiddler all the good signs including the 200 (OK) status. When I try to upload other files (.xls, .vsd), it fails with a 400 (Bad Request) status. I'm very surprised that a .doc would work and a .xls and .vsd would fail.

It is consistent as well. I've uploaded several .doc files successfully without any failures. I've also tried to upload several .xls files - some succeed, some fail (the successes are consistent over and over, the failures are consistent over and over). As I write this and test more and more files, there is a .pdf file that consistently produces a 504 (Fiddler - Receive Failure) error.

FYI, I am using Flex on the client and using the FileReference class to do the uploads. The Flex code is as standard as they come - using this code with the only change being the WCF REST URL: http:[url].....

View 1 Replies

Actionscript 2 :: Flash - IO Error While Uploading Photo With Low Uploading Internet Speed?

Mar 1, 2010

Actionscript:
System.security.allowDomain("http://" + _root.tdomain + "/");
import flash.net.FileReferenceList;

[code].....

View 2 Replies

Flex :: Adobe Air And REST Communication?

Mar 2, 2012

Can someone recommend me a good example of Adobe air and REST API communication and authentication?

View 1 Replies

Actionscript 3 :: Do Lightweight REST Calls In Flex

Dec 19, 2010

We are converting a Flex application to use some REST APIs.

When adding the mx.rpc.http.HTTPService class to the code, the SWF binary output grew from 175KB to 260KB. This is an unacceptable hit.

Is there any better way to do lightweight REST calls from a Flex app? Are we better off using an external interface JS just to make the calls from there?

View 2 Replies

Flex :: Consume A REST Web Service With Flashbuilder 4?

Apr 21, 2011

I am creating a Restful WCF web service which will need to be consumed by FlashBuilder 4. Is this possible? If so, how can I go about doing that?

View 2 Replies

Flex :: Get A Popup To Scroll With The Rest Of Application

Sep 28, 2011

Positioning / Scrolling problem with Flex popup I am trying to get the main control bar on my application to control the location of a popup that has been opened using PopUpManager. create PopUp(this,JakePanel,false);Initially the page looks like this:After I scroll the page it looks like this: What I would like is for the Popup to scroll with everything else.[code]

View 1 Replies

File Is Uploading Very Slow

Oct 19, 2011

I have a SWF file - 220KBand the motions are simple too.whay the browser loading it so slow?!?(5-10 sec.)(i checked on 7 computers)

View 3 Replies

ActionScript 3.0 :: Uploading File From Mac?

Jul 2, 2009

i am uploading file from pc its working perfectly fine on safari,firefox,IE,chrome and selecthandlers and completehandlers are working perfectly but on MAC files was uploaded i did't get response so that i can hide the loader bar i think complete handler not working perfectly or any other reason .....

View 3 Replies

Actionscript 3.0 :: File Uploading In MAC?

Jun 28, 2010

My code work fine in Windows system but it wont work at the MAC OSX. In MAC it wont load file when the file name having space in between.Please see the code for reference.

Code: Select all
package {
import flash.display.Loader;

[code].....

View 1 Replies

IDE :: Change File Name Before Uploading?

Feb 6, 2009

I am using the file reference tutorial to upload an image to the serverobviously it works great. but I want to make each file upload unique, so if I upload mypicture.jpg to the server, I want to change the name of the file to mypicture1039094.jpg (or something that is unique).part 2:I want to also capture that new random file (mypicture1039094.jpg) in a text field so I can send it to a php script.

View 5 Replies

Flex :: Delay Repeater Until Rest Of View Has Loaded?

May 30, 2010

I have a flex repeater for an accordion inside a TitleWindow that is quite slow, I've already set recycleChildren to true, which has helped, but it's still slow on the first load and causes the animation to stutter when I open the TitleWindow.

The repeater is just one part of what's visible in the TitleWindow, what I would like to do is have the repeater load after the rest of the content in the TitleWindow so the animation of the TitleWindow being opened doesn't stutter (the main problem).

View 1 Replies

Flex :: Pass An Array To A Function Using The ... Rest Construction?

Feb 2, 2011

I'm making multiple similar calls with similar results to one remote object. Because these calls are so similar and very changeable, I've been keeping the name of the remote method in a config file, and when I need to make the call I use getOperation() on the remote object, and call send() on the operation object. However, the requirements have changed so that not all of the calls will have the same number of parameters. Because send uses ..., will I be able to continue using the same formation and pass an array, or will send() treat that as passing one argument of type array?

View 2 Replies

No Sound From Its File After Uploading To Website

Mar 29, 2011

After building a flash using one of the players provided by KoolMoves in the interface, I checked to make sure the sound played properly and it did. I checked to be sure it was still in the contents file and it was. I uploaded it to my website and all plays great but I have no sound. I've checked to make sure my sound is not muted and speakers connected and all other sound plays fine. The progress bar for the player does not show when it is clicked eiither, as if there is no sound file in the player.

View 1 Replies

ActionScript 3.0 :: Get RemainingTime On Uploading A File?

Jan 27, 2009

how to calculate Remaining Time of a file to upload on a server using AS3 and Flash Player 10.I have designed a File Uploader and its workign fine and i am displaying the progressbar in it but now i want to know how to calculate the Remaining Time of a file to upload.i am trying to calculate it with ProgressEvent.bytesLoaded and bytesTotal, but its not working for me. the loading of bytes by flash always comes different.

View 6 Replies

ActionScript 3.0 :: Flash CS3 File Uploading In Mac OS?

Jul 24, 2009

I have a major problem with File Uploading through PHP backend in mac OS it works fine in Windows OS but not in Mac. So how to resolve this problem? Is it Flash Side bug or PHP Side bug???

View 1 Replies

ActionScript 3.0 :: Progress Bar For File Uploading?

Apr 18, 2011

i want to make a progress bar uploading, for a bitmap image that is in flash library ,using URLLoader and URLRequest.but ProgressEvent doesn't work true and it happends just when uploading is finished.i search and find that with apc_fetch in php we can find the total and current bytes uploaded in server.but the sample was in html and php and it needs a hidden type with an  id in http form.but i don't know how do it in flash.

a simple example in http and php is :
<form action="" method="post" enctype="multipart/form-data" name="uploadImage" id="uploadImage"><p><label for="image">Upload image:</label><input type="hidden"

[code]....

View 6 Replies

Uploader - File Uploading With Flash?

Dec 16, 2011

I am gonna make my own flash file-uploader, but I can't find any good materials. how to make a simple flash uploader.

View 1 Replies

ActionScript 2.0 :: Get New Name Of File After Uploading It To Server?

Oct 1, 2009

I want to upload multiple files. For this I used FileReference and it works fine. I m able to upload the files properly.

When i upload a file i change its file name from "pic1.jpg" to something like "asdfwer.jpg"

Now i want to get this new name of a file - so for that i set cookie using setcookie() in php. But the problem is "Cookie is not being set" I dont get the reason for that.[code]...

View 0 Replies

ActionScript 3.0 :: SWF File Missing When Uploading In FTP

Jun 21, 2010

I have a *.swf file and once i uploaded it in my ftp server to publish my flash website on the web. and when I go to my website no movie loaded in the flash player and once I check the FTP server where my web files are. My SWF file disappear. I complete the files needed to run the Flash website and its in my FTP server but only the SWF file disappear. My SWF file size is 12.2 mb, the 2 scripts needed in running the flash website are this expressInstall.swf, swfobject_modified.js. I am using Flash CS4 using AS 3.0 I'm really new to this software..

View 6 Replies

ActionScript 2.0 :: Uploading A .txt File Dynamically Through The .swf?

Nov 12, 2003

I made a dynamic text field inside of a movie clip. I then dragged the scroll bar component over, and it worked, yeah! But they Im uploading a .txt file dynamically through the .swf The text displays and is selectable but it does not scroll. The scroll bar is there but doesn't work.

View 2 Replies

ActionScript 2.0 :: Uploading File With Flash And Php

Oct 5, 2008

im currently having a proble with uploading an image with Flash I used filereference The deal is that i should save first the file to be uploaded in a variable then after all needed has been entered there will be a save button at the end how will i be able to save the file saved in my variable in the database

[Code]...

View 1 Replies

Flex :: Rest - Adding Crossdomain.xml To Tomcat 6.0.24 To Access Webservices?

Oct 28, 2010

I have to deploy a webapp on Tomcat 6.0.24, serving some webservices that should be accessed with REST-style methods (not fully REST, since the used flex class HTTPService can just send GET and POST).

The webservices are deployed at [URL]

The problem is that the policy of flex sandbox (i think it is called so) requires that the server with the services has to offer a file crossdomain.xml on his root directory.

I created that file with the following contents:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>

[Code].....

I am testing it and it does not seem to work. Maybe i am not doing it right. PS: I think Apache is not configured to manage Tomcat-addressed requests, every request is dispatched by port, i think. I can not provide the exact flex error since i am not developing that part. I will try to make a minimal example in the next hours and see if i can reproduce the problem.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved