Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7988091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:20:05+00:00 2026-06-04T12:20:05+00:00

I have a zip file that is created using drag and drop on a

  • 0

I have a zip file that is created using drag and drop on a view in my desktop Flex 4.6 app.

This triggers a service that will automatically upload the zip file.

I am able to use the following code to send metadata about the zip file to the server.

        var urlRequest:URLRequest = new URLRequest(PUBLISH_ZIP_FILE_URL);
        // set to method=POST
        urlRequest.method = URLRequestMethod.POST;          



        var params:URLVariables = new URLVariables();



        params['data[File][title]'] = 'Title1';
        params['data[File][description]'] = 'desc';         
        // params['data[File][filename]'] =  I am not sure exactly what to use here 
        // If this is a webpage, I expect to use input type="file" with the name as data[File][filename]


        urlRequest.data = params;

        addLoaderListeners();

        // set it such that data format is in variables
        loader.dataFormat = URLLoaderDataFormat.VARIABLES;

        loader.load(urlRequest);

I have read https://stackoverflow.com/questions/8837619/using-http-post-to-upload-a-file-to-a-website

However, immediately they start off with ByteArray, which I am not sure how to convert my zip file at all.

Please advise.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:20:07+00:00Added an answer on June 4, 2026 at 12:20 pm

    Embarrassing but I found my answer 42 mins after I posted the question.

    A little bit of a rubber duck problem solving going on here.

    http://www.codinghorror.com/blog/2012/03/rubber-duck-problem-solving.html

    Short answer: Use File class and specifically the method upload which is extended from the FileReference class.

    Long answer:

            var urlRequest:URLRequest = new URLRequest(PUBLISH_ZIP_FILE_URL);
            // set to method=POST
            urlRequest.method = URLRequestMethod.POST;
    
            var params:URLVariables = new URLVariables();
    
            params['data[File][title]'] = 'Title1';
            params['data[File][description]'] = 'desc';
    
            // this is where we include those non file params and data
            urlRequest.data = params;
    
    
            // now we upload the file
            // this is how we set the form field expected for the file upload
            file.upload(urlRequest, "data[File][filename]");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found that creating a zip file using the Zip task provided by
Using this I have written code to first created a zip folder and then
I have a ZIP archive that's embedded inside a larger file. I know the
I have a small job that takes a text file of email/zip codes and
I have .zip file which contain csv data. I am reading .zip file using
I have always wondered about this. So many application setups have a zip file
I'm using the web deploy API to deploy a web package (.zip file, created
i have some web based application that creates a zip file when user asks
I have several large zip file that contain a dir structure that I must
I have a Zip archive with a large (important) file that will not extract.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.