> ## Content Index
> Fetch the complete content index at: https://www.albert-yu.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# 2019ironman 10th – Cloud Native – Day07 – Elastic Beanstalk 操作說明(4)
- URL: https://www.albert-yu.com/blog/2019ironman-10th-cloud-native-day07-elastic-beanstalk-operations-4/
- Published: 2018-10-20T17:00:46.000Z
- Updated: 2026-10-30T03:43:09.000Z
- Author: Albert Yu
- Tags: 2019ironman 10th - Cloud Native - AWS Elastic Beanstalk & Devops 網站維運實戰, Ithome鐵人賽

## Day07 - Elastic Beanstalk 操作說明(4)

#### 10

##### 程式上碼的上傳

Elastic Beanstalk 建立之後首先會遇到的第一個問題，程式碼怎樣上傳與怎樣打包。

在還沒結合Devops時我們可以將程式碼打包上傳

從Running Version進入後點選壓縮的檔案進行上傳，支援ZIP或WAR

![](https://www.albert-yu.com/content/images/2026/10/2019ironman-10th-cloud-native-day07-elastic-beanstalk-cao-zuo-shuo-ming-4-01.png)

![](https://www.albert-yu.com/content/images/2026/10/2019ironman-10th-cloud-native-day07-elastic-beanstalk-cao-zuo-shuo-ming-4-02.png)

這邊有個重點是打包的方式

常常有人打包上傳後失敗

原因是因為解壓縮之後是否會產生資料夾

如果要不產生資料夾的最簡單方式

直接進入資料夾底層然後選取底層文件進行壓縮

假設我現在要有個資料夾叫 test

資料夾內有兩個檔案 index.html 與 logo.png

通常大家的習慣是點選資料夾來壓縮

但是這樣上傳之後

`http://ElasticBeanstalkURL/index.html` 這樣會跳出404

`http://ElasticBeanstalkURL/test/index.html` 這樣才會顯示出index頁面

這是一個使用Elastic Beanstalk常見的錯誤

不要犯這個錯

在程式碼上傳基本上不會出錯